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. Advertisements

  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
     
    Bryan Porter, Nov 29, 2007
    #2
    1. Advertisements

  3. Axel Dahmen

    Axel Dahmen Guest

    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.



    ----------------
     
    Axel Dahmen, Nov 29, 2007
    #3
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.