Dim str As String
str = "select * from datework where empid='" & ComboBox1.SelectedValue & "'"
str &= " And datework BETWEEN " & datework.Value & " And " & datework1.Value & ""
da = New OleDbDataAdapter(str, Conn)
dt = New DataTable
da.Fill(dt)
DateworkDataGridView.DataSource = dt
Dim str As String
str = "select * from datework where empid='" & ComboBox1.SelectedValue & "'"
str &= " And datework BETWEEN '" & datework.Value.tostring("s") & "' And '" & datework1.Value.tostring("s") & "'"
da = New OleDbDataAdapter(str, Conn)
dt = New DataTable
da.Fill(dt)
DateworkDataGridView.DataSource = dt
Dim str As String
str = "select * from datework where empid='" & ComboBox1.SelectedValue & "'"
str &= " And datework BETWEEN " & CDate(datework.Value) & " And " & CDate(datework1.Value) & ""
da = New OleDbDataAdapter(str, Conn)
dt = New DataTable
da.Fill(dt)
DateworkDataGridView.DataSource = dt '
Code (VB.NET)
Dim str As String
str = "select * from datework where empid='" & ComboBox1.SelectedValue & "'"
str &= " And datework BETWEEN '" & CDate(datework.Value.ToString("s")) & "' And '" & CDate(datework1.Value.ToString("s")) & "'"
da = New OleDbDataAdapter(str, Conn)
dt = New DataTable
da.Fill(dt)
DateworkDataGridView.DataSource = dt