I'm in the process of modifying my project to work with table adapters only rather then a combination of table and data adapters.
How do I set up my code so it displays data only containing the entered date?
How do I set up my code so it displays data only containing the entered date?
VB.NET:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If (RaceDate.Text.Length = 0) Then
' Do Nothing
Else
Dim RaceDateString As String = Me.RaceDate.Text.Trim 'Me.RaceDate.Text.Substring(6, 1).ToString + Me.RaceDate.Text.Substring(7, 1).ToString() + Me.RaceDate.Text.Substring(8, 1).ToString + Me.RaceDate.Text.Substring(9, 1).ToString + Me.RaceDate.Text.Substring(5, 1).ToString + Me.RaceDate.Text.Substring(3, 1).ToString + Me.RaceDate.Text.Substring(4, 1).ToString + Me.RaceDate.Text.Substring(2, 1).ToString + Me.RaceDate.Text.Substring(0, 1).ToString + Me.RaceDate.Text.Substring(1, 1).ToString
MsgBox(RaceDateString.ToString)
Me.VsrDataTableAdapter.SelectCommand(0).CommandText = "select * from VsrData"
Dim stWhere As String = ""
If RaceDateString <> "" Then
stWhere = "RaceDate = " + RaceDateString
MsgBox(28)
MsgBox(stWhere.ToString)
End If
If stWhere = "" Then
Me.VsrDataTableAdapter.Fill(Me.EquinexMasterSqlDataSet.VsrData)
MsgBox(33)
Else
Me.VsrDataTableAdapter.FillByWhere(Me.EquinexMasterSqlDataSet.VsrData, stWhere)
End If
End If
End Sub