Question Locked

search code in vb.net

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
i have a database in microsoft access and i designed an interface for it in vb.net. ive been trying to write code for the 'search' command which i can use to retrieve individual records from the database. tried the code used in vb 6.0 but it dint work.so i would like to know that which is used in vb.net

2 replies

by seaziz_ksa

You can write the following codes to search any specific data:

Dim Srhdata As New DataView

srhdata.Table = ClientsDataSet.Tables(0)
srhdata.RowFilter="Client_no"& textBox1.Text

If srhdata.Count > 0 Then
TextBox2.Text = srhdata(0)(2)

msflex.AddItem(srhdata(0)(2))

End if

Note: You must connect first to a database from Data menu > Add new data source.

This discussion is closed to new replies.