Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi. i want add message to table with dataset. i done that with sqlDatasource but i want do that with dataset in code behind.
in sqlDatasource i use this query string for product_id insert:

C#
<asp:QueryStringParameter Name="Product_id" QueryStringField="product_id" Type="Int32" />


how can i insert produc_id in insert dataset query?


thanks
Posted

1 solution

Use the following line of code to retrieve querystring value.

C#
string prodId = HttpContext.Current.Request.QueryString["product_id"];
 
Share this answer
 
v2
Comments
Member 11829564 30-Jul-15 6:09am    
Unfortunately that's not working...
error: cannot apply indexing with [] to an expression of type 'method group'

i should say product_id is the parameter from default.aspx page.
thanks
himanshu agarwal 30-Jul-15 6:48am    
Apologies, my bad, please try updated solution.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900