Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Search query using search term from user input into TextBox

 
Logged in as: Guest
arrSession:exec spGetSession 2,7,50067
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [General Forum] >> Other Programming/Scripting Languages >> Search query using search term from user input into TextBox
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Search query using search term from user input into Tex... - 7/27/2007 2:05:11 AM   
  Mendoza

 

Posts: 1
Score: 0
Joined: 7/27/2007
Status: offline

Hi everyone, thank you for the help you provide on this forum, I've learned a lot so far.

Right now I'm making a simple Access-Visual Basic 2005 .NET database. I want to make a Search Query that will search the Database for text similar to what the user inputs into TextBox1.Text on the form where the datagrid is displayed.

I've created a query that works if:

SELECT...
FROM...
WHERE mycolumn = 'oxygen'

for example. It will retrieve and display all matches for oxygen, so the query itself works. But it does not work with the variations I have tried on:

SELECT...
FROM...
WHERE mycolumn = ' "TextBox1.Text" '
The query is:

SELECT FirstName, LastName, City, Major, StudentID FROM Students
WHERE FirstName LIKE ...

I want to be able to search the column <FirstName> for the text that the user inputs in TextBox1.Text and then display the parts of the datagrid that match that.

A blank datagrid appears. I don't think the query is able to see what TextBox1.Text contains.

What do you recommend I do to make this work? Or what alternatives exist to making a robust search button with search terms?

Thanks,

Mendoza
 
 
Post #: 1
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [General Forum] >> Other Programming/Scripting Languages >> Search query using search term from user input into TextBox Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts