Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Linking and querying a database

  • 08-10-2013 01:07PM
    #1
    Registered Users, Registered Users 2 Posts: 2,554 ✭✭✭


    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