Click to See Complete Forum and Search --> : Passing a DataSet from one aspx class to another


johnmcTemp
June 24th, 2002, 10:00 PM
I have a webform class structure for each of 2 pages: A.aspx & B.aspx

In both classes for A & B, I declare a DataSet object to hold query data.

In the first class structure (page A) i fill the DataSet object with a SQL query.

When user clicks a button, page A will perform a Redirect() to page B. But...before that redirect happens, I want to store the dataset into page B.

My first guess was to create the following function in class B:

public void SetDataSet(ref DataSet ds) {...}

and call it from page A:
B.SetDataSet(ref my_page_A_Dataset);

But that doesnt seem to work.
Is what I am trying to do possible? Here is the error I get when compiling:
An object reference is required for the nonstatic field, method, or property WebApp.B.SetDataSet(ref System.Data.DataSet)'

Do I need a reference to page B somehow?

Not sure what to do, need help guys...