Private Sub Search_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Search.Click
'The OleDbDataReader is a forward-only data reader used for speed and efficiency.
Dim SQLReader As OleDbDataReader
'Dim Searchstr As String = ""
Dim Searchstr As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\NRaqa\Desktop\TestD.mdb"
Dim conn As OleDbConnection
conn = New OleDbConnection(Searchstr)
Dim query As String = "Select NAME FROM KonkeQuery where NAME like '%storename.text%'"
Dim command As New OleDbCommand(query, conn)
If storename.Text = "" Then
MsgBox("Please Enter Strore name", MsgBoxStyle.Exclamation)
Exit Sub
Else
conn.Open()
SQLReader = command.ExecuteReader()
If SQLReader.HasRows Then
While SQLReader.Read
storename.Text = SQLReader.Item(query)
End While
Else
MsgBox("There were no matches found, please try again", MsgBoxStyle.Information)
End If
conn.Close()
End If
End Sub
I'm trying to select a query on the database where by it uses like ie. '%storename.text%.. i want it to display all the storenames with the entered data so that i can select which eva 1 i want
Thanks in advance
Regards
Noks

New Topic/Question
Reply




MultiQuote




|