Hi All
OK, so I am a newbie to
vb.net .... I am using Visual Basic 2005 Express having previously only ever used Visual Basic 6....
Now, what I am doing is developing an app that will allow searching of my Access Database. For this (under vb6) I used the old DataControl to flick thru the d/base and used the following code to search my address book for any particular person (using my field titled Surname):
' Search database button and functionality
Private Sub SearchButton_Click()
Dim Content As String
Content = Trim(txt_findTitle.Text) & "*"
' Searching the "LAST" Field in the database (last name)
Content = "Surname like '" & Content & "'"
If txt_findTitle <> "" Then
databar.Recordset.FindFirst Content
If databar.Recordset.NoMatch = True Then
MsgBox "No match found"
End If
End If
End Sub
This worked perfectly, showed the results in my form to the bound controls....
Now, all I want to do is replicate this in my new .net version of my app!!!
I have hunted the web and cannot find a means to do this so any help would be much MUCH appreciated as Im losing hair at a rate of knots!!
For info, within my .net app - I am using the BindingNavigator and done it all via the wizard as it was so much easier (and of course, gave me the buuilt in controls for >> << and add delete etc....if poss, I wanna keep using this but as I say, very confused on how best to do this.
All I really want to add is a textbox to accept a string (for the Surname search) and a command button to kick the search off with the FULL record for that surname returned or a "no item found" msgbox , as I had under vb6!!
Help, would be MUCHOS appreciated!
Cheers
Col