Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Linking and querying a database

Options
  • 08-10-2013 1:07pm
    #1
    Registered Users Posts: 2,466 ✭✭✭


    I am using Visual Web Developer 2010 to develop a database driven website in C#.

    I have linked the database to the website and when I use the SqlDataSource tool from the toolbox, I can view information from the database.

    My question is:
    How do I generate an SQL query using data gathered from a textbox?

    For example:
    In the customer table I have FirstName & LastName. I want to be able to query the database to display all customers by the name entered in the textbox (e.g. "John").

    Is there a generic code which can be used to execute sql statements using variables?

    Any help would be greatly appreciated.


Comments

Advertisement