|
-
Dec 23rd, 2009, 07:10 PM
#1
Thread Starter
Member
search in datagridview
hello
my program i abot searching in a database viewed by datagridview
and i want to search within two columns
i'm using this code to do so:
Code:
InstructorsBindingSource.Filter = "PhoneNumber = '" & Trim(ToolStripTextBox1.Text) & "' and instructors = '" & Trim(ToolStripTextBox2.Text) & "'"
but its not working
so any suggested ideas
-
Dec 24th, 2009, 12:18 AM
#2
Addicted Member
Re: search in datagridview
im not sure whether you can write like
a=b=c format
-
Dec 24th, 2009, 07:19 AM
#3
Re: search in datagridview
Define "not working". Remember that we haven't seen your project in action and we don't know what's in your head, so you need to provide a FULL and CLEAR explanation. EXACTLY what are you doing, EXACTLY what do you expect to happen and EXACTLY what does happen?
-
Dec 24th, 2009, 01:19 PM
#4
Thread Starter
Member
Re: search in datagridview
when starting to search the whole statement is highlighted
what i need is a code for a search box which search within two columns in database
more:if there is in database name john then when i enter letter o then john appears in datagridview as one of the suggestions
and at the same time if there is a phone number of 637267382 in database then if i enter 7
then this number will appear as one of the suggestion in datagridview
i got a code that only shows suggestions that is only contains what is common betwwen the names and phone number
-
Dec 24th, 2009, 05:57 PM
#5
Thread Starter
Member
Re: search in datagridview
i solve it using this code
vb Code:
InstructorsBindingSource.Filter = "PhoneNumber like '%" & Trim(ToolStripTextBox1.Text) & "%' or instructor like '%" & Trim(ToolStripTextBox1.Text) & "%'"
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
|