K
Kevin O'Brien
Hey guys,
I am querying a sql database for a matches using wild cards. If I return
more than one record I want to prompt the user to choose the best match.
What is the best way to do this? I thought I could put the matching records
into a label and have the user select the item that they want but when using
that method I am only getting the values in the label item and not the
recordID. Any help is greatly appreciated. My code is below.
Thanks,
Kevin
thisConnection.Open()
Dim scalarCommand As New SqlCommand("Select Count(*) FROM Users where
FirstName like '" & TextBox2.Text & "%' OR LastName like '" & TextBox2.Text
& "%'", thisConnection)
Dim intCount = scalarCommand.ExecuteScalar()
TextBox99.Text = intCount.ToString()
If intCount > 1 Then
End If
I am querying a sql database for a matches using wild cards. If I return
more than one record I want to prompt the user to choose the best match.
What is the best way to do this? I thought I could put the matching records
into a label and have the user select the item that they want but when using
that method I am only getting the values in the label item and not the
recordID. Any help is greatly appreciated. My code is below.
Thanks,
Kevin
thisConnection.Open()
Dim scalarCommand As New SqlCommand("Select Count(*) FROM Users where
FirstName like '" & TextBox2.Text & "%' OR LastName like '" & TextBox2.Text
& "%'", thisConnection)
Dim intCount = scalarCommand.ExecuteScalar()
TextBox99.Text = intCount.ToString()
If intCount > 1 Then
End If