Click here to Skip to main content
16,004,854 members

Comments by Member 9663328 (Top 6 by date)

Member 9663328 20-Oct-14 4:39am View    
Actually Datagridview1 and Datagridview2 is in the same form so two tables show up im using this code to get the due date and put it in the month applied

DataGridView2.Rows(counter).Cells("MONTH_APPLIED").Value = (DataGridView1.Rows(counter).Cells("DUE_DATE").Value)

counter is + 1

in my code i get the rows in sequential

MONTH_APPLIED OPB
10/20/14 1500
11/20/14 3000
12/20/15 4500
1/20/15 6000

but i want it to be like this

MONTH_APPLIED OPB
10/20/14 1500
12/20/14 3000
1/20/15 4500
3/20/15 6000

Im thinking this has something to do with this code i just dont know how to get it.

If DataGridView2.Rows(0).Cells("OPB").Value > DataGridView1.Rows(0).Cells("OPB").Value Then
'what code should i put to get the output
ElseIf DataGridView2.Rows(0).Cells("OPB").Value < DataGridView1.Rows(0).Cells("OPB").Value Then
'what code should i put to get the output
End If
Member 9663328 3-Oct-14 2:26am View    
if you'll see in the column of No of Days

31 - 31
61 - 30
92 - 31



The number of days should not be adding. it should be 30,31. 28 or 29 if leap year depends on the due date from the previous day.
Member 9663328 2-Oct-14 21:55pm View    
please check this link it has picture of my code.

http://www.dreamincode.net/forums/uploads/monthly_10_2014/post-650638-141229598642.png
Member 9663328 9-Jun-14 4:51am View    
i don't have a master table, my primary key is the id. i don't have foreign key
Member 9663328 29-Apr-14 21:14pm View    
is there something wrong in my code?

Try
Dim cmd As OleDbCommand = New OleDbCommand("SELECT Project, COUNT(Project) FROM Table1 GROUP BY Project", con)
opendatabase()
Dim myDA As OleDbDataAdapter = New OleDbDataAdapter(cmd)
Dim myDataSet As DataSet = New DataSet()
myDA.Fill(myDataSet, "MyTable95")
DataGridView1.DataSource = myDataSet.Tables("MyTable95").DefaultView
closedatabase()
Catch ex As Exception
MessageBox.Show(ex.ToString)
Finally
closedatabase()
End Try