Can we store a dataset in a session? How?
Answers (1)
Add AnswerDataSet ds = new DataSet();
DataTable dt = new DataTable();
DataColumn dc = new DataColumn(“name”,typeof(string));
dt.Columns.Add(dc);
dt.Rows.Add(“Priyank”);
dt.Rows.Add(“Sagar”);
dt.Rows.Add(“Parth”);
ds.Tables.Add(dt);
Session.Add(“Dataset-Demo”, ds);
DataSet val = (DataSet)Session[“Dataset-Demo”];
Yes, we can do this, the example is given below, if you like the answer give me an upvote😁