C# .NET - Best to pass dataset one page to another page
Asked By Abhi Rana
07-Nov-09 01:23 AM
I want to know best/secure way to pass dataset from one aspx page to another aspx page.
web mavin replied to Abhi Rana
Besides using Session or Query string or ViewState to hold you dataset to pass to other page, you could think of using Cache object. Read more on this at this http://www.4guysfromrolla.com/articles/100902-1.aspx and http://www.codeproject.com/KB/web-cache/Data_Caching_in_ASPNET.aspx.
One more option is use
Also, read on options of state management that are described in this article: http://msdn.microsoft.com/en-us/magazine/cc300437.aspx
re
best and secure way to pass dataset from one aspx page to another aspx page is Session.
u can store DataSet in session variable on first page
Session["DS"] = objDs;
and then u can redirect to another page and access that dataset on other page as follows
DataSet objDS;
objDS = Session["DS"];

the in-memory representation of data is the recordset. In ADO.net, it is the dataset A recordset looks like a single table in ADO In contrast, a dataset is a collection of one or more tables in ADO.net ADO is designed primarily recordset. ADO.NET the data adapter allows you to control how the changes to the dataset are transmitted to the database. On order to get assembly info which namespace we should in c#.net How do you get records number from 5 to 15 in a dataset of 100 records? Write code. Answer1 DataSet ds1 = new DataSet(); String strCon = ”data source = IBM-6BC8A0DACEF;initial catalog = pubs;integrated security = SSPI;persist” +” security info = False user id = sa;workstation id = IBM-6BC8A0DACEF;packet size = 4096?; String strCom1 = ”SELECT * FROM employee”; SqlDataAdapter sqlDa1 = new SqlDataAdapter(strCom1, strCon); ds1.Tables.Add(”employee”); sqlDa1
Large query Here is my problem. I have to produce a query that encompasses data from three tables. Table Schema: HSCTI Table ItemID [PK] cust_name reason status short_desc Comments Table ItemID[PK] ct_number[FK] post_date author comments I need to produce a query that will rollup data to be printed out in a report as such: Customer Information [HSCTI] Call Tracking Information [CTPT] Comments [Comments] I can produce a query easily enough that will include inner joins but the problem is that I get Customer need is three select statements. The results in ADO.NET would come back as a DataSet containing three tables. Ronald, Here is some sample data: Is there a way I can reports, I don't think you need to eliminate the duplicated Customer Information in your query result. If you are using the query result for ASP.NET application, all you need to to is to query each table seperatedly and fill
new SqlConnection (ConnectionString); SqlDataAdapter ad = new SqlDataAdapter ( "SELECT UserID, FirstName, LastName, Url FROM Users" , myConnection); DataSet ds = new DataSet (); ad.Fill(ds); GridView1.DataSource = ds; GridView1.DataBind(); } As, you can see the above code is pretty straight forward and you DataField = "FirstName" HeaderText = "First Name" / > < asp : TemplateField HeaderText = "Image"> < ItemTemplate > < asp : Image ID = "Image1" ImageUrl = ' <%# (string) FormatImageUrl( (string) Eval("Url")) %> ' runat = "server" / > < / ItemTemplate > < / asp : TemplateField > < / Columns > < FooterStyle BackColor = "#FFFFCC" ForeColor = "#330099" / > < RowStyle BackColor used to assign the correct url to the ImageUrl property of the Image control. protected string FormatImageUrl( string url) { if (url ! = null && url.Length > 0) return ( "~ / " + url); else return null ; } The
3 tier architecture in asp.net Hi all, I want to learn 3 tier concepts in asp.net. so kindly send the sample project code , how to create 3 tier layers in asp.net. Sample example code for 3 tier architecture. I think you could refer to the following links to get started. #3-tier architecture in asp.net with C# http: / / www.dotnetfunda.com / articles / article71.aspx #Creating a Data Access Layer http
from Database Data Now that you know how to create a simple image from an ASP.NET Web page, you can create more complex (and useful) images. For the remainder of this information. I'll build all of this functionality into a set of functions in an ASP.NET Web page that will end up streaming the dynamically created pie chart's binary content hand, a more reusable solution would be to encapsulate this functionality into a custom-defined ASP.NET Web control or compiled custom control. One disadvantage of such an approach, though, would be that the custom-defined ASP.NET Web control or compiled custom control would have to save the image's file to