2 textboxes to accept fromdate and todate and check with the database column of ida,rda and if matches then display only that row.
I tried it in the below way but not able to do.
con.Open()
i = DataGridView1.CurrentCell.RowIndex
cmd = New SqlCommand("SELECT COUNT(*) FROM IssueMBA WHERE ida='" + TextBox1.Text + "'and rda='" + TextBox2.Text + "'", con)
dr = cmd.ExecuteReader()
If Not dr.Read() Then
MsgBox("Invalid details")
ElseIf ((dr(3).ToString() = TextBox1.Text) And (dr(4).ToString() = TextBox2.Text)) Then
DataGridView1.Rows(i).Cells(0).Value.ToString()
DataGridView1.Rows(i).Cells(1).Value.ToString()
DataGridView1.Rows(i).Cells(2).Value.ToString()
DataGridView1.Rows(i).Cells(3).Value.ToString()
DataGridView1.Rows(i).Cells(4).Value.ToString()
End If
con.Close()