I want to retrieve data on another page using datagrid in asp.net?
-
hi i want to retrieve data on another page using datagrid in asp.net,the code is here Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click ' Response.Redirect("webform1.aspx", True) myConnection = New SqlConnection("server=localhost;uid=sa;p… myConnection.Open() dim frm as webform2 Dim cmd As SqlCommand Dim DS As New DataSet Dim MyCommand As New SqlDataAdapter("select vehiclemake,vehiclemodel,vehiclecolor,ve… from tblcustomer1 where name = 'JOHN GARCIA (SUPER)-DEL'", myConnection) MyCommand.Fill(DS, "tblcustomer1") frm. DataGrid1.DataSource = DS.Tables("tblcustomer1").DefaultView frm. DataGrid1.DataBind() but it does not work plz help;here i have tried to call webform2 as frm.i want to see my result on webform2 while i am doing these complexities on another form.
-
Answer:
The question is vague because it does not explicitly mention which data to be shared across two pages. As a matter of fact, It doesn't matter how the data in the first page was displayed (i.e. whether in a DataGrid or otherwise). The typical way to exchange the data between the two pages in this case is to store it in a Session Variable while at the first page then accessing the Session Variable from the 2nd page. Assuming the data to be shared is DS.Tables("tblcustomer1") , then in your first page you should go for something like: Session("tblCustomer1") = DS.Tables("tblcustomer1") In your 2nd Page you can read the Session Variable into another DataTable Dim dt as DataTable dt = CType(Session("UserName"), DataTable) Hope this helps.
durbal s at Yahoo! Answers Visit the source
Other answers
Refresh page then copy and paste again,good luck
dietzel362000
Related Q & A:
- How can I allow user to create posts in website using ASP.NET?Best solution by Programmers
- How to Search using jQuery ASP.Net?Best solution by Stack Overflow
- How to save high resolution image canvas to server using asp.net?Best solution by Stack Overflow
- How can I fix parser Error in ASP.NET?Best solution by parse.com
- Is there some kind of API for MSN protocol (for using in C# asp.net application?Best solution by Stack Overflow
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.