?
Solved

passing dataset from one page to another

Posted on 2014-04-09
7
Medium Priority
?
464 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

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 1000 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

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

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

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

762 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