I am not sure how to work with DataGridViews or DataSets.
So if textbox1.text = x/x/2013 and textbox2.text = y/y/2014, then clicking a button will filter the records and display only those records with corresponding date values in the data grid view.
The biggest part I am struggling with is getting the records via search button. Here's what I have so far:
Expand|Select|Wrap|Line Numbers
- Dim SQLConnection As New SqlConnection("Data Source=SQLTEST_HR,4000\SQLEXPRESS;Integrated Security=True")
- Dim SqlCommand As New SqlCommand
- Dim SQLReader As SqlDataReader
- Dim dt As New DataTable
- 'Dim SqlCommand As New SqlCommand("Select * FROM PARTICIPANT WHERE FIRST_NM_TXT = " & Trim(SearchFirsttxt.Text) & "'", SQLConnection)
- SqlCommand.Connection = SQLConnection
- SQLConnection.Open()
- SqlCommand.CommandText = "Select * FROM PARTICIPANT WHERE FIRST_NM_TXT = '" & Trim(SearchFirsttxt.Text) & "' and LAST_NM_TXT = '" & SearchLastTxt.Text & "'"
- Dim myAdapter As New SqlDataAdapter(SqlCommand)
- myAdapter.Fill(dt)
- DataGridView1.DataSource(dt)
- SQLConnection.Close()
Thanks