Retrieving a specific row from a table

Discussion in 'Databases' started by vickyb, Mar 11, 2004.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Hi,
    I can retrieve a whole table called "customer" from my access database but i need to be able to allow users to enter their customer ID on the webpage, and then this will send back only their information rather than everyones.
    Please could someone explain to me how to do this or where i should go to get the information i need
    Any help at all would be appreciated [:)]

    Thanks
    Vicky
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    You would use a where clause to do that.

    eg.

    select * from customer where customerID = 12345


    quote:Originally posted by vickyb

    Hi,
    I can retrieve a whole table called "customer" from my access database but i need to be able to allow users to enter their customer ID on the webpage, and then this will send back only their information rather than everyones.
    Please could someone explain to me how to do this or where i should go to get the information i need
    Any help at all would be appreciated [:)]

    Thanks
    Vicky

    </blockquote id="quote"></font id="quote">
     
  3. i am very new to asp.net so some sample code would be really helpful. if you could point me in the right direction, that would be great!
    Thanks very much for your help
    Vicky
     
  4. Thanks for that,
    but how does it work if i dont want to hard code it? So a customer can come to the page enter their number in a text box and it brings up their information. what code do i need then after the WHERE customerID =

    Thanks
    Vicky
     
  5. Do you want some sample code or suggested reading/training?[?]

    HPC
     
  6. Vicky,

    Right now you have a string that says:

    "SELECT * FROM Customer WHERE CustomerID = 12345"

    Let's say the textbox on your webpage is named txtID. You can get access to what the user typed in by using the "Text" property of the textbox. Your updated string would look like:

    "SELECT * FROM Customer WHERE CustomerID =" & txtID.Text

    Does that help?
     
  7. Thats exactly what i wanted to do!
    Thanks for your help! [:)]
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page