473,379 Members | 1,539 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

Can I make OleDb data in one page available to another page

I'm fairly new to this ASPX/OLEDB stuff. I have an OleDbDataReader in one
..aspx page. I do a Server.Transfer to another page. Is it possible to make it
so that the data in the OleDbDataReader is available to the other page, so I
don't have to go back to the database?
--
Dave
Nov 19 '05 #1
2 1188
Hi Dave,

When you use Server.Transfer to transfer from one Page to another, the first
Page remains as the HttpHandler in the Context. So, you can access any
public value in the first Page class via something like the following:

FirstPageClass firstpage;
if (!IsPostBack) // Via Server.Transfer
{
firstpage = (FirstPageClass)Context.Handler;
}

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Everybody picks their nose,
But some people are better at hiding it.

"Dave" <Da**@discussions.microsoft.com> wrote in message
news:97**********************************@microsof t.com...
I'm fairly new to this ASPX/OLEDB stuff. I have an OleDbDataReader in one
.aspx page. I do a Server.Transfer to another page. Is it possible to make
it
so that the data in the OleDbDataReader is available to the other page, so
I
don't have to go back to the database?
--
Dave

Nov 19 '05 #2
Thanks Kevin. That works fine. However, it sems to only work in the Page_Load
event. I'd like to be able to get at the information in other places, like in
a button click event, but it doesn't seem to work. Do you know the trick for
this, or am I being too ambitious?
--
Dave
"Kevin Spencer" wrote:
Hi Dave,

When you use Server.Transfer to transfer from one Page to another, the first
Page remains as the HttpHandler in the Context. So, you can access any
public value in the first Page class via something like the following:

FirstPageClass firstpage;
if (!IsPostBack) // Via Server.Transfer
{
firstpage = (FirstPageClass)Context.Handler;
}

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Everybody picks their nose,
But some people are better at hiding it.

"Dave" <Da**@discussions.microsoft.com> wrote in message
news:97**********************************@microsof t.com...
I'm fairly new to this ASPX/OLEDB stuff. I have an OleDbDataReader in one
.aspx page. I do a Server.Transfer to another page. Is it possible to make
it
so that the data in the OleDbDataReader is available to the other page, so
I
don't have to go back to the database?
--
Dave


Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Parking Meters | last post by:
Today I managed to get the OleDB provider to let me put datasets from an as400 using sql. Great, the provider string I used is: Provider=IBMDA400.DataSource.1;User ID=XXXXX;Password=XXXX;Data...
12
by: Parking Meters | last post by:
Today I managed to get the OleDB provider to let me put datasets from an as400 using sql. Great, the provider string I used is: Provider=IBMDA400.DataSource.1;User ID=XXXXX;Password=XXXX;Data...
0
by: silesius | last post by:
I've been using VS.NET 2003 to develop a webapplication using C#. Today I exported the application to another webserver I begun experiencing problems. It's a simple application that retrieves...
5
by: petro | last post by:
Hello all, My asp.net web application works on my machine but I get the following error on our test web server, There is only one oracle home on the test server. Does anyone know how to resolve...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.