Elegant way of returning FieldNames?

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default Elegant way of returning FieldNames?

    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 Guest

  2. Similar Questions and Discussions

    1. #40064 [NEW]: Wrong fieldnames in result (including table alias names)
      From: christoph at ziegenberg dot de Operating system: Windows XP SP2 PHP version: 5.2.0 PHP Bug Type: PDO related Bug...
    2. IE 6 and form fieldnames
      I've run into a simple (I hope) problem where a form in IE 6 will not pass the fieldnames correctly. Attached is an example. In Opera/Firefox and...
    3. Elegant exit on the console
      Hi, I'm a relatively inexperienced perl (in the form of ActivePerl on Windows 98 SE) user who wonders how to most elegantly exit a program from...
    4. Retrieving (Data + Fieldnames) from database to array?
      Hi, I'd like to poll a database and get the table contents, as well as the field names from that table. I've been to php.net but this time I...
    5. standard fieldnames
      Hi all, I have set up several databases now, but I'm always a little bit clumsy with giving proper fieldnames. As the db is growing bigger and...
  3. #2

    Default Re: Elegant way of returning FieldNames?

    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"
    [url]http://support.microsoft.com/?id=310107[/url]

    Alos an interesting read

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


    --
    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" <jbalapa_nosam@atginc.com> wrote in message
    news:#6CZvASXDHA.1004@TK2MSFTNGP12.phx.gbl...
    > 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\) Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139