How to pass the dataset values with session into another page

Asked By karthik karthik
09-Sep-10 04:20 AM
Earn up to 0 extra points for answering this tough question.
Hai Friends

In my page i am having three dataset for  eg ds,ds1.ds2.these three dataset values i am redirecting to a another page with the session name like this eg:session["karthik"].in that page i want that three dataset values how to do this.
tx in advance

  re: How to pass the dataset values with session into another page

Sagar P replied to karthik karthik
09-Sep-10 04:24 AM
Better way to use 3 session values like;

Session["DataSet1"]= ds1;
Session["DataSet2"]= ds2;
Session["DataSet3"]= ds3;

And on other page you can use it like;

DataSet ds1 = (DataSet)Session["DataSet1"];
DataSet ds2 = (DataSet)Session["DataSet2"];
DataSet ds3 = (DataSet)Session["DataSet3"];

  re: How to pass the dataset values with session into another page

Reena Jain replied to karthik karthik
09-Sep-10 05:05 AM
hi,

if you want to pass specific value then do this

session["karthik"]=ds1.Tables[0].[0][0].tostring();


hope this will also help you

  re: How to pass the dataset values with session into another page

Anand Malli replied to karthik karthik
09-Sep-10 05:48 AM
Hi Karthik

Why you are taking three datasets??? I mean do al dataset contain more then one table in it?? what i would suggest it to use one dataset and put all your datatable collection in one dataset only,so you can easily manage the things

i do not know how much i know abt your requirement but i think you can combine them in one datasetmand otherwise Session["karthik"]=ds1; is the solution to your problem

let me know
thxs
  re: How to pass the dataset values with session into another page
Goniey N replied to karthik karthik
10-Sep-10 02:09 AM
-- Try Below


-- In "my page.aspx"...

Session["karthik"] = ds;

            
-- In "another page.aspx"...
-- Here For Dataset You have To Use "System.Data" namespace So If You Not Use It Then You Can Write Directly Below Code Or If You Use Then You Can Use Directly "DataSet"...

System.Data.DataSet ds = (System.Data.DataSet)Session["karthik"];


-- Hope This Help You....            
Create New Account
How to pass the dataset values with session into another page Hai Friends In my page i am having three dataset for eg ds, ds1.ds2. these three dataset values i am redirecting to a another page with the session name like this eg:session["karthik"]. in that page i want that three dataset values how to do this. tx in advance Better way ds3; And on other page you can use it like; DataSet ds1 = (DataSet)Session["DataSet1"]; DataSet ds2 = (DataSet)Session["DataSet2"]; DataSet ds3 = (DataSet)Session["DataSet3"]; hi, if you want to pass
hoe to merge the two dataset into one dataset in c# hai friends I am one dataset like this ds like three columns this: - -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- tblkey Empkey Empname T102 E11 Siva T103 E14 ganesh I am having another dataset ds1 only two columns like this: - -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Empkey Empname E10 karthi E11 thriu E13 maran i waant merge the dataset and check the values while checking if ds is not joins. The joined table will contain all records from both tables, and fill in NULLs for missing matches on either side can find how to do full join on two data tables on this Article . Karthik, The following code will show you how to merge the are going to loop through the data in the second dataset (the data you want to merge). For each item, simply search the first dataset for that item. If it doesn't exist in the
how to merge the two dataset without duplicates hai freinds I am having two datasets like 101 RAJA 2 105 POOJA 3 106 THRIU 4 109 karthik 5 110 hari i shoud get a output in ds 101 RAJA 2 105 POOJA 3 106 THRIU 4 109 karthik 5 110 hari I think you have to write your own logic for this. . . . See this function; public static DataSet MergeResultSets DataSet ds = null; int checkCount = 0; string rowPosition = ""; try { ds = DAL DataAcess.Sample(param1, param2); for (int i = 0; i < = ds.Tables[0].Rows.Count - 1; i++) { for (int j = 0; j < = ds.Tables[1].Rows.Count - 1; j++) { if (Equals(ds Tables[0].Rows[i].ItemArray().Count, ds.Tables[1].Rows[j].ItemArray().Count)) { for (int k = 0; k < = ds.Tables[0].Rows[i].ItemArray().Count - 1; k++) { if (Equals(ds
to Add Identity Col Value to DataRow DsAddressBook1 is the Dataset The Table "Address_Lst" has an Identity Col "ADDRESS_ID "(seed) Dim dt As DataTable = DsAddressBook1.Tables("Address_Lst") Dim dr As DataRow = DsAddressBook1.ADDRESS_LST.NewRow dr("FIRST_NM Configure DataAdapter". The select, insert and update commands generated automatically. Karthik Bala . . . http: / / msdn.microsoft.com / library / default.asp?url = / library
SelectedIndex Value from Bound Control I have 3 Tables Data Structure Below Table1: ADDRESS_ID INT ( Seed ) Primary Key ST_ID Key CNT_NM VARCHAR(50) I have created 3 DataAdapter one Dataset Default.aspx file has a datagrid, textbox controls and Update Sub UpdateRow() DsAddressBook1 = Session("dsAddressUSA") Dim dt As DataTable = DsAddressBook1.Tables("Address_Lst") Dim dr As DataRow() 'Get the seleced row using Sub InsertRow() DsAddressBook1 = Session("dsAddressUSA") Dim dt As DataTable = DsAddressBook1.Tables("Address_Lst") Dim dr As DataRow = DsAddressBook1.ADDRESS_LST.NewRow dr("FIRST_NM object. Could any one help me to resolve this error. Karthik Bala Create New Account
int result DATATABLE Result(RID, C_Grp, C_Type) var PMBQuery = ds1.Tables[ "PMB" ].AsEnumerable(); var MosQuery = ds1.Tables[ "Mos" ].AsEnumerable(); var query = ( from m in MosQuery join p and get the resulting datatable having columns from both input tables. Thanks You can join two or more table in query you need this is working in my project / / Join 3 tables and show couple fields from each DataClasses1DataContext dcx = new DataClasses1DataContext Of using the Linq to Datatable U Can use the dataset Merge Concept Like this: - -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - For Eg tablename1, tablename2 Contains like POOJA 3 106 THRIU EMPKEY EMPNAME tablename2 - -- -- -- -- -- -- -- -- -- -- -- -- -- -- - - -- -- -- -- -- -- -- -- -- -- -- -- -- -- - 102 RAJA 103 KARTHIK 105 POOJA 109 ROJA this .Page.Unload + = new EventHandler (Page_Unload); sconn.Open(); DataSet ds = new DataSet (); SqlDataAdapter da = new SqlDataAdapter ( "SELECT * from tablename1" , sconn); da.Fill ds); da = new SqlDataAdapter ( "SELECT * from tablename2" , sconn); DataSet ds1 = new DataSet (); da.Fill(ds1); / / ds.Merge(ds1); ds.Tables.Add( new
ToString()); } Thanks, Nowshad hi for ( int i = 0; i < ds.Tables[0].Rows.Count; i++) { DropDownList1.Items[i].Attributes.Add( "Title" , ds.Tables[0].Rows[i][ "empname" ].ToString()); } DropDownList1.ToolTip = DropDownList1.SelectedItem.Text is on the items in the dropdown. Thanks for replying karthik. What i need is on combobox dropdown in C#.NET empkey as final, empname from tablename11 order by tblkey" , con); DataSet ds = new DataSet (); da.Fill(ds); DropDownList1.DataSource = ds.Tables[0]; DropDownList1.DataValueField = "final" ; DropDownList1.DataTextField = "final" ; DropDownList1.DataBind(); for int i = 0; i < ds.Tables[0].Rows.Count; i++) { DropDownList1.Items[i].Attributes.Add( "Title" , ds.Tables[0].Rows[i][ "empname" ].ToString()); } DropDownList1.ToolTip = DropDownList1.SelectedItem.Text
It still shows up the same error. HELP ME! Hi Karthik, I have done the same code in C#.Net windows n im really very down. . . can you help me? Hi Karthik Please try below code for asp.net ; protected void Page_Load Dere's another doubt, You have coded using two data tables. But I want it using data set. When I try using dataset the ' dt.Rows.Add(dataRow);' option and 'dataRow = dt.NewRow