Thursday, March 29, 2012

Pass recordset from code-behind to aspx file

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?
ThanksIt 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.
slowmotiongenius@.gmail.com wrote:
> 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
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
<slowmotiongenius@.gmail.com> wrote in message
news:1149866390.158704.78010@.g10g2000cwb.googlegroups.com...
> 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.
>
> slowmotiongenius@.gmail.com wrote:
>
slowmotiongenius@.gmail.com wrote:
> 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...rver2client.asp
or this, if you don't really need the recordset functionality:
http://www.davidpenton.com/testsite...ata.islands.asp
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
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!
sloan wrote:
> 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 datasour
ce
> 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 usuall
y
> 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
>
> <slowmotiongenius@.gmail.com> wrote in message
> news:1149866390.158704.78010@.g10g2000cwb.googlegroups.com...
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?
slowmotiongenius@.gmail.com wrote:
> 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!
>
> sloan wrote:

0 comments:

Post a Comment