Pass recordset from code-behind to aspx file

Discussion in 'ASP .Net' started by slowmotiongenius@gmail.com, Jun 9, 2006.

  1. Guest

    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
    , Jun 9, 2006
    #1
    1. Advertising

  2. Guest

    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.


    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
    , Jun 9, 2006
    #2
    1. Advertising

  3. sloan Guest

    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



    <> wrote in message
    news:...
    > 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.
    >
    >
    > 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

    >
    sloan, Jun 9, 2006
    #3
  4. 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/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

    --
    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"
    Bob Barrows [MVP], Jun 9, 2006
    #4
  5. Guest

    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 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
    >
    >
    >
    > <> wrote in message
    > news:...
    > > 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.
    > >
    > >
    > > 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

    > >
    , Jun 9, 2006
    #5
  6. Guest

    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?


    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:
    > > 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
    > >
    > >
    > >
    > > <> wrote in message
    > > news:...
    > > > 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.
    > > >
    > > >
    > > > 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
    > > >
    , Jun 12, 2006
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ben Miller [msft]

    Re: Code Behind vs. no code behind: error

    Ben Miller [msft], Jun 27, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    569
    Alphonse Giambrone
    Jun 28, 2003
  2. Guest
    Replies:
    1
    Views:
    3,082
    Hermit Dave
    Dec 15, 2003
  3. Paolo Pignatelli
    Replies:
    6
    Views:
    2,166
    Paolo Pignatelli
    Feb 21, 2005
  4. John

    Non-code behind to code behind

    John, Feb 19, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    466
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Feb 19, 2007
  5. Hung Huynh
    Replies:
    8
    Views:
    291
    Bob Barrows
    Sep 24, 2003
Loading...

Share This Page