PDA

View Full Version : Retrieving a specific row from a table


vickyb
03-11-2004, 02:17 AM
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

bruce
03-12-2004, 10:56 AM
You would use a where clause to do that.

eg.

select * from customer where customerID = 12345


[b]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">

vickyb
03-13-2004, 01:34 AM
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

vickyb
03-13-2004, 08:46 AM
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

petercon
03-13-2004, 12:50 PM
Do you want some sample code or suggested reading/training?[?]

HPC

GreenGuy
03-15-2004, 03:52 AM
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?

vickyb
03-16-2004, 03:57 AM
Thats exactly what i wanted to do!
Thanks for your help! [:)]