Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Retrieving a specific row from a table

Status
Not open for further replies.

Vicky999

Technical User
Mar 6, 2004
2
GB
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? I'm very new to asp.net so i'm sorry if this is post sounds really easy!
Any help at all would be appreciated :)

Thanks
Vicky
 
You must use the WHERE statement on your OleDb call.
(Ex.
select * from customers
where customerid = xxxx....etc( and more descripters).

The idea is to return only one row so that you can show the customer only their info.
On another note I hate to have SQL code that is so open, as this may lead to SQL Injection attacks. You should do client-side validation (only allow strings that you know will be OK). You can do this by using the ASP validation controls with a regular expression attached.
Klaz
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top