|
-
Jan 8th, 2007, 09:09 AM
#1
Thread Starter
New Member
[RESOLVED] [2005] Ms
Pls help. Am tryin to retrieve data from a database using a query.
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) <-------------this lne is bein skipped even if the user enters part of the string dat is d
End While
Else
MsgBox("There were no matches found, please try again", MsgBoxStyle.Information)
End If
conn.Close()
End If
End Sub
Thanks in advance
Regards
Noks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|