nilkanthnaik5's Profile User Rating: -----

Reputation: 4 Apprentice
Group:
Contributors
Active Posts:
16 (0.02 per day)
Joined:
22-October 12
Profile Views:
1,007
Last Active:
User is offline Jan 30 2013 02:03 AM
Currently:
Offline

Previous Fields

Dream Kudos:
25
Icon   nilkanthnaik5 has not set their status

Posts I've Made

  1. In Topic: For..Next Nested Loop

    Posted 12 Dec 2012

    Ok friends.
    Forget all of this and keep suggesting and pointing to right direction.
    Always welcome for your suggestion.
  2. In Topic: For..Next Nested Loop

    Posted 12 Dec 2012

    @modi123_1- I already have mentioned that it's slightly changed code not a new code. Mr.Modi first execute the code.
    If you get the proper solution then its good otherwise forget it or you give me the solution for the same.
  3. In Topic: For..Next Nested Loop

    Posted 11 Dec 2012

    Hi friends..

    I have modified your code.
    Please try this.

    
    Private Sub calcButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
            'displays the stores and company payroll
    
            Dim inputPayroll As String
            Dim store1Payroll As Double
            Dim storeAccumulator As Double
            Dim companyAccumulator As Double
    
            'clear the storeLabels and companyLabel
            store1Label.Text = ""
            store2Label.Text = ""
            store3Label.Text = ""
            companyLabel.Text = ""
    
            For stores As Integer = 1 To 3
    
                For amounts As Integer = 1 To 5
    
                    inputPayroll = InputBox("Amounts for payroll " & amounts.ToString, "Store " & stores.ToString)
    
                    Double.TryParse(inputPayroll, store1Payroll)
                    ' add amount to store sales
                    storeAccumulator += store1Payroll
    
                Next amounts
    
                ' add store sales to company sales
                companyAccumulator += storeAccumulator
    
                ' display store payrolls
                If stores = 1 Then
                    store1Label.Text = companyAccumulator.ToString("N2")
                End If
                If stores = 2 Then
                    store2Label.Text = (Convert.ToDouble(companyAccumulator - store1Label.Text)).ToString("N2")
                End If
                If stores = 3 Then
                    store3Label.Text = (companyAccumulator - (Convert.ToDouble(store1Label.Text) + Convert.ToDouble(store2Label.Text))).ToString("N2")
                End If
    
            Next
            companyLabel.Text = "Company sales: " & companyAccumulator.ToString("C2")
        End Sub
    
    
    
  4. In Topic: [VB.NET 2010] Populate Gridview from SQL

    Posted 11 Dec 2012

    Try this..............

    dataadapter.Fill(ds, "Remove_Part")
    
    DataGridView1.DataSource = ds.Tables("Remove_Part")
    
    


    OR
    dataadapter.Fill(ds)
    
    DataGridView1.DataSource = ds.Tables(0)
    
    
  5. In Topic: if else in datetime in vb.net

    Posted 29 Nov 2012

    Hi uttar.
    I am answering your first question.
    I am giving you 2 solutions.
    I think 1st is better.
    Try first solution:-


    Public Function GetCustomDate(ByVal days As Int32) As String
            Dim objDate1 As DateTime = DateTime.Now()
            Dim objDate2 As DateTime = objDate1.AddDays(-1 * days)
            Dim str1, str2, str3, strfinal As String
            str1 = (objDate1.Year - objDate2.Year) & " Years"
            str2 = (objDate1.Month - objDate2.Month) & " Months"
            str3 = (objDate1.Day - objDate2.Day) & " Days"
            If str1 <> "0 Years" Then
                strfinal = strfinal + str1
            End If
    
            If str2 <> "0 Months" Then
                strfinal = strfinal + str2
            End If
            If str3 <> "0 Days" Then
                strfinal = strfinal + str3
            End If
    
            Return strfinal
    End Function
    
    



    Try Second solution:-

    Public Function GetCustomDate(ByVal days As Int32) As String
    
    Dim objDate1 As DateTime = DateTime.Now()
    Dim objDate2 As DateTime = objDate1.AddDays(-1 * days)
    
    If (objDate1.Year - objDate2.Year) <> 0 And (objDate1.Month - objDate2.Month) <> 0 And (objDate1.Day - objDate2.Day) <> 0 Then
                Return (objDate1.Year - objDate2.Year) & "Years" & (objDate1.Month - objDate2.Month) & "Months" & (objDate1.Day - objDate2.Day) & " Days"
     
    ElseIf (objDate1.Year - objDate2.Year) = 0 And (objDate1.Month - objDate2.Month) <> 0 And (objDate1.Day - objDate2.Day) <> 0 Then
                Return (objDate1.Month - objDate2.Month) & "Months" & (objDate1.Day - objDate2.Day) & " Days"
    
    ElseIf (objDate1.Year - objDate2.Year) <> 0 And (objDate1.Month - objDate2.Month) = 0 And (objDate1.Day - objDate2.Day) <> 0 Then
                Return (objDate1.Year - objDate2.Year) & "Years" & (objDate1.Day - objDate2.Day) & " Days"
    
    ElseIf (objDate1.Year - objDate2.Year) <> 0 And (objDate1.Month - objDate2.Month) <> 0 And (objDate1.Day - objDate2.Day) = 0 Then
                Return (objDate1.Year - objDate2.Year) & "Years" & (objDate1.Month - objDate2.Month) & "Months"
    
    ElseIf (objDate1.Year - objDate2.Year) <> 0 And (objDate1.Month - objDate2.Month) = 0 And (objDate1.Day - objDate2.Day) = 0 Then
                Return (objDate1.Year - objDate2.Year) & "Years"
    
    ElseIf (objDate1.Year - objDate2.Year) = 0 And (objDate1.Month - objDate2.Month) <> 0 And (objDate1.Day - objDate2.Day) = 0 Then
                Return (objDate1.Month - objDate2.Month) & "Months"
    
    ElseIf (objDate1.Year - objDate2.Year) = 0 And (objDate1.Month - objDate2.Month) = 0 And (objDate1.Day - objDate2.Day) <> 0 Then
                Return (objDate1.Day - objDate2.Day) & " Days"
    
    ElseIf (objDate1.Year - objDate2.Year) = 0 And (objDate1.Month - objDate2.Month) = 0 And (objDate1.Day - objDate2.Day) = 0 Then
                Return (objDate1.Day - objDate2.Day) & " Days"
    End If
    
    End Function
    
    

My Information

Member Title:
New D.I.C Head
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:

Contact Information

E-mail:
Click here to e-mail me

Friends

nilkanthnaik5 hasn't added any friends yet.

Comments

nilkanthnaik5 has no profile comments yet. Why not say hello?