Jump to content

Search code not working!!!


shelly121

Recommended Posts

any1 help please? basically iv wrote the code to search for a client name in a database(in access) IN vb.net and this is the code:

Private Sub BtnSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)

'search

If txtSearch.Text = "" Then MsgBox("Please type Client Name", MsgBoxStyle.Critical, "Enter Text") : Exit Sub

 

Dim MYDA As OleDbDataAdapter1 = New OleDbDataAdapter()

Dim MYDS As DataSet = New DataSet()

 

RS = New ADODB.Recordset()

RS.Open("SELECT * FROM CLIENT WHERE NAME LIKE '" & txtSearch.Text & "%' ", CN, ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockOptimistic)

MYDA.Fill(MYDS, RS, "NAME")

DataGrid1.DataSource = MYDS.Tables(0)

End Sub

End Class

 

but it underlines the "OleDbDataAdapter1" in the

Dim MYDA As OleDbDataAdapter1 =. .......

but i dont know why as that is what my dataAdapter is called??

please help, id be very grateful!!!!!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.