The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value,
Private Sub DataFilter_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DataFilter.Click
Dim connstring As String = "Data Source=BM-PC;Initial Catalog=EquinexMasterSql;Integrated Security = True"
Dim sql As String = "SELECT * FROM VsrData WHERE RaceDate ='" & RaceDate.Text.Trim & "'"
Dim conn As SqlConnection = New SqlConnection(connstring)
Try
da = New SqlDataAdapter(sql, conn)
da.SelectCommand = New SqlCommand(sql, conn)
builder = New SqlCommandBuilder(da)
conn.Open()
ds.Clear()
da.Fill(ds, "VsrData")
VsrDataGridView.DataSource = ds.Tables("VsrData")
Catch ex As Exception
MsgBox(ex.ToString.Trim)
End Try
conn.Close()
End Sub
Private Sub DataFilter_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DataFilter.Click
Dim connstring As String = "Data Source=BM-PC;Initial Catalog=EquinexMasterSql;Integrated Security = True"
Dim sql As String = "SELECT * FROM VsrData WHERE RaceDate ='" & RaceDate.Text.Trim & "'"
Dim conn As SqlConnection = New SqlConnection(connstring)
Try
da = New SqlDataAdapter(sql, conn)
da.SelectCommand = New SqlCommand(sql, conn)
builder = New SqlCommandBuilder(da)
conn.Open()
ds.Clear()
da.Fill(ds, "VsrData")
VsrDataGridView.DataSource = ds.Tables("VsrData")
Catch ex As Exception
MsgBox(ex.ToString.Trim)
End Try
conn.Close()
End Sub