Friday, March 30, 2012

Query ProductID in Stored Procedure

I have created a Stored Procedure:

SELECT ID, Productname, Price, Desc, img_url
FROM Products
WHERE (ID =[ --Products.aspx?ID=x --])

Question: I want to view the product details for that ID in QueryString on my ASP.Net pagewww.myhomepage.com/Product.aspx?ID=2. How do I?...


Using:
FormView1
SqlDataSource
VB/ASP.Net 2005 & SQL Server 2005 Express.

you need to create a store procedure which can take one parameter called product_id..

You need to add this parameter in your storeprocedure and then call the procedure..

|||

Hi!

Can you please spesify an example?Embarrassed

|||

You can use QueryStringParameter in a SqlDataSource, take a look at this article:

http://aspnet.4guysfromrolla.com/articles/030106-1.aspx

No comments:

Post a Comment