![]() |
|
|
|
| ||||||
|
Welcome to the The ProgrammersTalk Community forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
| Tags: |
![]() |
![]() | | LinkBack | Thread Tools | Display Modes | ![]() |
| |||
| [SOLVED] 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;pwd databa se=emp")myConnection.Open() dim frm as webform2 Dim cmd As SqlCommand Dim DS As New DataSet Dim MyCommand As New SqlDataAdapter("select vehiclemake,vehiclemodel,vehiclecolor,vehicleyear, city 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. |
| |
| |||
| 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. |
![]() |
| Thread Tools | |
| Display Modes | |
| |