Populating webform with data from database [Resolved]

Posted by Rasagna under ASP.NET on 12/29/2015 | Points: 10 | Views : 269 | Status : [Member] | Replies : 1
In my Sample project i have used approach of session variable(where i stored id which is the primary key) and DataReader to populate data into a webform from database.Is there any other way to do it instead of using session variable?I have also heard of approach using querystring but not sure of how it works.so can you suggest other ways to do it with an example instead of using session variable(Beginner level).


Posted by: Sheonarayan on: 12/29/2015 [Administrator] HonoraryPlatinum | Points: 50


If you would have downloaded the 3-tier architecture article source code suggested in answer of this post http://www.dotnetfunda.com/forums/show/20943/transfer-of-data-from-gridview-to-webform, you would get to know about it.

In short, you might be doing like this

int id = Session["Id"];
do it like
int id = Request.QueryString["id"]; // retrieve querystring from the url


Sheo Narayan

Rasagna, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response