Dear fellow programmers,
I am trying to build a form that has two datetimepickers (for date range) and one button. When a user clicks the button the datagridview will show results according on the date range (by the two datetimepickers).
This is my code so far:
Dim dbconnection As New OleDbConnection(Get_Constring) 'database path from a module Dim connectionstring As String = "SELECT * From EncodingComplete where (DATEVALUE(Date_Bill) >= DATEVALUE('" & DateTimePicker1.Text & "') and DATEVALUE(Date_Bill) <= DATEVALUE('" & DateTimePicker2.Text & "')) order by Date_Bill asc " Dim dbadapter As New OleDbDataAdapter(connectionstring, dbconnection) Dim clientdataset As New DataSet() dbadapter.Fill(clientdataset, "date1") Dim clientview As New DataView(clientdataset.Tables("date1")) DataGridView1.DataSource = clientview DataGridView1.DataBind() 'this is where the error is.. its purpose is to bind results to the datagridview
The error is on DataGridView1.DataBind(). Can somebody help me??