Elegant way of returning FieldNames?

Discussion in 'ASP .Net' started by Jay Balapa, Aug 7, 2003.

  1. Jay Balapa

    Jay Balapa Guest

    Hello,

    Iam creating a query page, in which a Drop Down List will have collection of
    fieldnames.

    Is there a elegant way of doing it?

    Currently Iam opening up a datareader and using GetName()/FieldCount() to
    get to fieldnames.


    I feel is is a waste, why would you need a resultset to get the
    fieldNamelist?


    Thanks
    Jay
    Jay Balapa, Aug 7, 2003
    #1
    1. Advertising

  2. A good MS articles exist that may be worth reading, it kinda explains when
    to use Datareader and why you would

    "HOW TO: Retrieve Column Schema by Using the DataReader GetSchemaTable
    Method and Visual C# .NET"
    http://support.microsoft.com/?id=310107

    Alos an interesting read

    "HOW TO: Retrieve Schema Information by Using GetOleDbSchemaTable and Visual
    C# .NET"
    http://support.microsoft.com/?id=309681


    --
    Regards

    John Timney (Microsoft ASP.NET MVP)
    ----------------------------------------------
    <shameless_author_plug>
    Professional .NET for Java Developers with C#
    ISBN:1-861007-91-4
    Professional Windows Forms
    ISBN: 1861005547
    Professional JSP 2nd Edition
    ISBN: 1861004958
    Professional JSP
    ISBN: 1861003625
    Beginning JSP Web Development
    ISBN: 1861002092
    </shameless_author_plug>
    ----------------------------------------------

    "Jay Balapa" <> wrote in message
    news:#...
    > Hello,
    >
    > Iam creating a query page, in which a Drop Down List will have collection

    of
    > fieldnames.
    >
    > Is there a elegant way of doing it?
    >
    > Currently Iam opening up a datareader and using GetName()/FieldCount() to
    > get to fieldnames.
    >
    >
    > I feel is is a waste, why would you need a resultset to get the
    > fieldNamelist?
    >
    >
    > Thanks
    > Jay
    >
    >
    John Timney \(Microsoft MVP\), Aug 7, 2003
    #2
    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. Beren

    Duplicate fieldnames in Datareader

    Beren, Jan 7, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    482
    Beren
    Jan 7, 2005
  2. rdack

    mysql fieldnames

    rdack, Aug 11, 2003, in forum: Python
    Replies:
    2
    Views:
    330
    BadJake
    Aug 12, 2003
  3. Ted To

    DictReader and fieldnames

    Ted To, Mar 19, 2009, in forum: Python
    Replies:
    0
    Views:
    297
    Ted To
    Mar 19, 2009
  4. Guest
    Replies:
    7
    Views:
    122
    Guest
    Dec 8, 2003
  5. Ward

    referencing an object's fieldnames

    Ward, Apr 12, 2006, in forum: Javascript
    Replies:
    2
    Views:
    74
Loading...

Share This Page