Solved

passing dataset from one page to another

Posted on 2014-04-09
7
449 Views
Last Modified: 2014-04-23
hi ,
     My task is on clicking a button all the values in the from and grid should pass to another Page. for example if click submit button in page A , all details(form and grid) form page A  should transfer to page B. here in page be i should assign these values.


My problem is in Page B grid is initialized only on row on page load. how to add rows dinamicatlly and assign the values.


Thanks in advance
0
Comment
Question by:codeoxygen
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
7 Comments
 
LVL 22

Expert Comment

by:Mrunal
ID: 39988535
Better way ideally you have to keep this data in cache/session.
0
 

Author Comment

by:codeoxygen
ID: 39988671
my problem is not passing data ... but how to assign the values to grid manually
0
 
LVL 13

Expert Comment

by:jitendra patil
ID: 39991124
can you post your .aspx and .cs code here, so that we can help you in better way?

just making assumtion, if you are passing dataset from one page to another using session, you just need to create an object of dataset or datatable, cast the data from session as below.
DataSet Dt= (DataSet)session["sessiondata"];
and bind the gridview with dataset object as
gridview.datasource=dt;
gridview.databind();

hope this helps.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:codeoxygen
ID: 39993390
my problem is , i have grid view , it has add new row button.  If i want bind data from a data-set. what is the method. the scenario is, already saved grid-view data should be retrieve and even it should be editable
0
 

Author Comment

by:codeoxygen
ID: 39993401
private void FirstGridViewRow()
        {
            DataTable dt = new DataTable();
            DataRow dr = null;
            dt.Columns.Add("RowNumber", typeof(int));
            dt.Columns["RowNumber"].AutoIncrement = true;
            dt.Columns["RowNumber"].AutoIncrementSeed = 1;
            dt.Columns["RowNumber"].AutoIncrementStep = 1;
           
            dt.Columns.Add(new DataColumn("Col2", typeof(string)));
            dt.Columns.Add(new DataColumn("Col3", typeof(string)));
            dt.Columns.Add(new DataColumn("Col4", typeof(string)));
            dt.Columns.Add(new DataColumn("Col5", typeof(string)));
            dt.Columns.Add(new DataColumn("Col6", typeof(string)));
            dt.Columns.Add(new DataColumn("Col7", typeof(string)));
            dt.Columns.Add(new DataColumn("Col8", typeof(string)));
         

            dr = dt.NewRow();
            //dr["RowNumber"] = 1;
            //dr["Col1"] = dr["RowNumber"].ToString();
            dr["Col2"] = string.Empty;
            dr["Col3"] = string.Empty;
            dr["Col4"] = string.Empty;
            dr["Col5"] = string.Empty;
            dr["Col6"] = string.Empty;
            dr["Col7"] = string.Empty;
            dr["Col8"] = string.Empty;
         

            dt.Rows.Add(dr);
            Session["CurrentTable"] = dt;
            dgdItem.DataSource = dt;
            dgdItem.DataBind();
        }


this is the grid which loads at the time of pageload. if button is clicked new row will be added. If want to add data set at the time of page load what is the prodecure
0
 
LVL 13

Accepted Solution

by:
jitendra patil earned 500 total points
ID: 39993712
0
 

Author Comment

by:codeoxygen
ID: 40001624
guru , thanks for ur answer.

but my problem is how to data to grid which exactly like
http://www.aspsnippets.com/Articles/Adding-Dynamic-Rows-in-ASP.Net-GridView-Control-with-TextBoxes.aspx

and after binding . the grid should be editable this my requirement
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

718 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question