|
-
Mar 23rd, 2004, 03:47 PM
#1
Thread Starter
New Member
database search
Hello all!
I am having difficulty coding for searching a database based on user entry in two textboxes. In VB6 you could do a partial searching using 'like' as soon as the user entered say 3 characters.
Ideally, I wanted to search a database and then populate a datagrid based upon what the user enters from either box. In the load event I have the following code:
dad(i.e. dataAdapter)
dtb (i.e. datatable)
cn = New OleDbConnection("Provider=SQLOLEDB;Data Source=Data3;Integrated Security=SSPI")
cn.Open()
SQLstr = "Select * from dbo.InstitutionTest"
cmm = New OleDbCommand(SQLstr, cn)
dtb = New DataTable
dad = New OleDbDataAdapter(SQLstr, cn)
dad.SelectCommand = cmm
dad.Fill(dtb)
From that point forward I wanted the first few characters entered in the textbox to immediately search the database and populate the datagrid. Any help would be great.
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
|