Professional Web Applications Themes

Elegant way of returning FieldNames? - ASP.NET General

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

  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. #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_nosamatginc.com> wrote in message
    news:#6CZvASXDHA.1004TK2MSFTNGP12.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

Similar Threads

  1. #40064 [NEW]: Wrong fieldnames in result (including table alias names)
    By christoph at ziegenberg dot de in forum PHP Bugs
    Replies: 1
    Last Post: January 8th, 02:44 PM
  2. IE 6 and form fieldnames
    By PegasusT4 in forum Macromedia ColdFusion
    Replies: 2
    Last Post: April 5th, 03:04 PM
  3. Retrieving (Data + Fieldnames) from database to array?
    By Josep in forum PHP Development
    Replies: 3
    Last Post: July 15th, 09:17 PM
  4. standard fieldnames
    By Rienk in forum FileMaker
    Replies: 3
    Last Post: July 8th, 04:44 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not 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