How Can I retrieve Column/Schema Information From ObjectDataSource

Discussion in 'ASP .Net' started by Axel Dahmen, Nov 29, 2007.

  1. Axel Dahmen

    Axel Dahmen Guest

    Hi,

    I'd like to retrieve and step through an ObjectDataSource's columns to be
    able to manually add BoundFields to a GridView control.

    I don't know how to do this other than to manually call the
    ObjectDataSource's Select() method. But this also retrieves all the data,
    which I don't want to get at that time.

    Your help is quite appreciated.

    Regards,
    Axel Dahmen
    Axel Dahmen, Nov 29, 2007
    #1
    1. Advertising

  2. Axel Dahmen

    Bryan Porter Guest

    Salutations Axel,

    The actual schema isn't calculated until ObjectDataSource constructs the
    ObjectDataSourceView for your object.

    That doesn't happen until you call Select() on ODS.

    --
    Regards,

    Bryan Porter
    http://www.bryanporter.com/

    "What A Horrible Night To Have A Curse!" - S. Belmont

    "Axel Dahmen" <> wrote in message
    news:...
    > Hi,
    >
    > I'd like to retrieve and step through an ObjectDataSource's columns to be
    > able to manually add BoundFields to a GridView control.
    >
    > I don't know how to do this other than to manually call the
    > ObjectDataSource's Select() method. But this also retrieves all the data,
    > which I don't want to get at that time.
    >
    > Your help is quite appreciated.
    >
    > Regards,
    > Axel Dahmen
    >
    >
    Bryan Porter, Nov 29, 2007
    #2
    1. Advertising

  3. Axel Dahmen

    Axel Dahmen Guest

    Re: How Can I retrieve Column/Schema Information From ObjectDataSo

    Hi Bryan,

    so there is no built-in way to just retrieve the schema information from a
    DataSource control? So if I understand the mechanism right, the Select()
    method will be called twice at every page cycle. I believe this might become
    quite expensive from time to time...

    I guess I will have to extend my Entity objects for a function to provide
    the Schema manually then.

    Appreciate your help!

    Regards,
    www.axeldahmen.de
    Axel Dahmen

    PS: Your link doesn't work. It always redirects to itself.



    ----------------
    "Bryan Porter" wrote:

    > Salutations Axel,
    >
    > The actual schema isn't calculated until ObjectDataSource constructs the
    > ObjectDataSourceView for your object.
    >
    > That doesn't happen until you call Select() on ODS.
    >
    > --
    > Regards,
    >
    > Bryan Porter
    > http://www.bryanporter.com/
    >
    > "What A Horrible Night To Have A Curse!" - S. Belmont
    >
    > "Axel Dahmen" <> wrote in message
    > news:...
    > > Hi,
    > >
    > > I'd like to retrieve and step through an ObjectDataSource's columns to be
    > > able to manually add BoundFields to a GridView control.
    > >
    > > I don't know how to do this other than to manually call the
    > > ObjectDataSource's Select() method. But this also retrieves all the data,
    > > which I don't want to get at that time.
    > >
    > > Your help is quite appreciated.
    > >
    > > Regards,
    > > Axel Dahmen
    > >
    > >

    >
    Axel Dahmen, Nov 29, 2007
    #3
    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. VickZaro
    Replies:
    1
    Views:
    2,476
    Spam Catcher
    Apr 5, 2006
  2. Markus
    Replies:
    1
    Views:
    1,499
    Markus
    Nov 23, 2005
  3. Stanimir Stamenkov
    Replies:
    3
    Views:
    1,173
    Stanimir Stamenkov
    Apr 25, 2005
  4. Mel
    Replies:
    9
    Views:
    661
    Hardeep Kaur
    Aug 9, 2007
  5. David Thielen

    ObjectDataSource method as another ObjectDataSource

    David Thielen, Mar 21, 2006, in forum: ASP .Net Web Controls
    Replies:
    3
    Views:
    229
    Steven Cheng[MSFT]
    Mar 23, 2006
Loading...

Share This Page