Filtering a table using input from a textbox using Visual Basic 2005

I have a simple question for you all but seems to be really hanging me up.
On my form I have a textbox that the user will enter a number. I want to use that number to filter a sql table and then display the result in my datagrid.
Here are the columns in the table: IMAGEID; SVID: FILENAME
The query would be something like this: Select *  IMAGEID, SVID, FILENAME FROM IMAGES WHERE SVID = "this would be the input from the user"

CR_OfficeAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jorge PaulinoIT Pro/DeveloperCommented:
You can do something like:

"SELECT * FROM IMAGES WHERE SVID = '" & Me.TextBox1.Text &"';"
0
CR_OfficeAuthor Commented:
That looks great how should it look in my code. I have Button that I call btnSearch to launch the action. Can you give me an example of code (VB2005)?
0
Jorge PaulinoIT Pro/DeveloperCommented:
Do you already something ?
0
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

CR_OfficeAuthor Commented:
Nothing
0
Jorge PaulinoIT Pro/DeveloperCommented:
Check this example from Microsoft MSDN

http://msdn2.microsoft.com/en-us/library/system.windows.forms.datagridview.datasource.aspx

All you have to do is change you SQLconnection and assing the update of the datagridview to a button click event changing the sql statement as required.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
CR_OfficeAuthor Commented:
Thanks for the example it is just what I needed.
0
Jorge PaulinoIT Pro/DeveloperCommented:
Gald I could help!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.