Hi i have a database where my duplicated data (serial no) are entered. Like
Serial Nos Chalan-no Abcd1234 VS/12-13/T-S/187 Abcd1234 VS/12-13/T-S/187 Xyz11234 VS/12-13/T-S/130 Xyz11234 VS/12-13/T-S/174
In this if I search for abcd1234
it will give me chalans-no VS/12-13/T-S/187
for both entries. It's OK, but if I search for xyz11234
it gives me chalans-no VS/12-13/T-S/130
only, not xyz11234
& VS/12-13/T-S/174
as it checks for serial no and gives its first occurrence. But what if I want xyz11234
& VS/12-13/T-S/174
?
I am Using following code to search for Serial No and retrieve chalan_no for that:---
Private Sub cmbSn_no_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmbSn_no.SelectedIndexChanged
'code to fill all details in text boxes when a Sr.No is selected in combobox
Dim strSelVen As String = ("SELECT * FROM Duplicate_srno where sr_no= @srno")
Dim comm_SelVen As OleDb.OleDbCommand = New OleDb.OleDbCommand(strSelVen, cnnOLEDB)
comm_SelVen.Parameters.AddWithValue("@srno", cmbSn_no.Text)
cnnOLEDB.Open()
Dim dr As OleDb.OleDbDataReader = comm_SelVen.ExecuteReader
If dr.Read = True Then
cmbSn_no.Text = dr("Sr_no")
cmbChal_no.Text = dr("chalan_no")
End If
cnnOLEDB.Close()
strsrno = cmbSn_no.Text
strchlno = cmbChal_no.Text
End Sub
Please suggest me what to do.