Pass recordset from code-behind to aspx file

  • Thread starter slowmotiongenius
  • Start date
S

slowmotiongenius

All-
I have established an adodb recordset in my code-behind, and I need to
pass it to the aspx file. I can't seem to figure out if there is a way
to do this. I see you can pass a string over using the
GetCallbackResult, but a recordset won't pass this way.

Any ideas???


Thanks
 
S

slowmotiongenius

It doesn't even have to be a recordset. It could be an array, etc. I
need a way to pass variables, beyond strings, from the aspx.vb file to
the aspx file.

Has anyone done this? I can't seem to figure it out.
 
S

sloan

Huh??

First, if you're using ADODB recordsets, you're probably doing something
wrong.

DataSets, IDataReaders are the "new" data model. If you used the upgrade
wizard, then I'd suggest refactoring that code.

...

You don't "pass" a datastore to the aspx file.
You usually put a control on the aspx page, and then bind it to a datasource
on the code behind page.

...

in 1.1, you'll do this

draw a datagrid on the aspx page.

on the page load

if (!Page.IsPostBack)
{
this.DataGrid1.DataSource = something;// where something is usually
a DataSet, IDataReader or an Array, or a CollectionBase
this.DataGrid1.DataBind();
}


asp.net is not an upgrade from asp. its a completely different animal
 
B

Bob Barrows [MVP]

All-
I have established an adodb recordset in my code-behind, and I need to
pass it to the aspx file. I can't seem to figure out if there is a way
to do this. I see you can pass a string over using the
GetCallbackResult, but a recordset won't pass this way.
If you really have an adodb.recordset, then you must be using interop,
right?
Anyways, you can do something like this:
http://www.davidpenton.com/testsite/tips/xml.recordset.server2client.asp

or this, if you don't really need the recordset functionality:

http://www.davidpenton.com/testsite/tips/xml.data.islands.asp
 
S

slowmotiongenius

Sorry, I'm using an adodb recordset because I wanted to set the
datasource of an office web component Pivottable equal to one. I read
that you could only use an xml file, a office web component data source
control, or a recordset. There was no mention of being able to use a
DataSet.

Now I can't draw the control for the Pivottable on the aspx page. I
have to place this in the aspx file
<-object classid="clsid:0002E552-0000-0000-C000-000000000046"
id="Pivot1" height="300" width="600"></object>

or do a response.write("<object
classid="clsid:0002E552-0000-0000-C000-000000000046" id="Pivot1"
height="300" width="600"></object>") in the aspx.vb pivottable.

Either way, the control isn't something that I can reference in the
aspx.vb by saying
Pivot1.DataSource = XXXXXXX
So I need to response.write("Pivot1.Datasource = " + adodbRS)
or some way to pass the record set over to the aspx file so I can
assign the datasource of the pivot table to it.

Does this make sense? Any way to accomplish something like this?

Thanks for the response!
 
S

slowmotiongenius

Someone has to have needed to do something like this in the past...any
tips on passing a recordset/dataset from the code-behind to the aspx
page?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top