The ProgrammersTalk Community
Forum Register Search Today's Posts Mark Forums Read
Register

Go Back   The ProgrammersTalk Community > Web Programming > ASP / ASP.NET


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:

Closed Thread
 
LinkBack Thread Tools    Display Modes   
  #1 (permalink)  
Old 06-10-2007, 05:11 PM
durbal s
Posts: n/a
[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;pwddataba 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.

__________________

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
  #2 (permalink)  
Old 06-10-2007, 05:13 PM
dietzel362000
Posts: n/a
Refresh page then copy and paste again,good luck

__________________

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
  #3 (permalink)  
Old 06-10-2007, 05:14 PM
Smutty Smutty is offline
Novice
Join Date: Jun 2007
Posts: 9
iTrader: (0)
Smutty is on a distinguished road
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.

__________________
Powered by Yahoo! Answers
Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
Closed Thread


Thread Tools
Display Modes

   Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -7. The time now is 06:15 AM. Powered by vBulletin
Copyright © 2000 - 2007, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO © 2007 ProgrammersTalk Sedo - Buy and Sell Domain Names and Websites project info: programmerstalk.net Statistics for project programmerstalk.net etracker® web controlling instead of log file analysis


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50