Hi, I'm a beginner in Vb.net. I have a problem like this.
My table name in dtabase is tblsales
and i have 4 combobox in month and year
i need to find data between this 4 combobox. And this is the code i've tried before.
For a As Integer = 0 To 11
Dim b As DateTime
ComboBox1.Items.Add(Format(b.AddMonths(a), "MMMM"))
Next
ComboBox1.SelectedIndex = 0
that one to fill the combobox with months and this code below to search the data
DA = New SqlDataAdapter("select * from tblpenjualan where month >='" & ComboBox2.Text & "' And month <='" & ComboBox4.Text & "' And year >='" & ComboBox3.Text & "' And year <='" & ComboBox5.Text & "'",CONN)
DS = New DataSet
DA.Fill(DS)
DGV.DataSource = DS.Tables(0)
DGV.ReadOnly = True
and it doesn't work. when i select between february 2006 and march 2006, it will also show data in january.
and when i select data between January 2006 and March 2006, it will not show data in february. I think it search data based on the first letter like 'J'anuary and 'M'arch..
please help with this...