interrogating database for field names/datatypes?

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

  1. #1

    Default interrogating database for field names/datatypes?


    I'm working primarily in ASP and transitioning to
    ASP.NET. This is probably entered to the wrong group but
    I'm not sure of what precise database technology I'm
    referencing.

    I have written a decent little "codewriter" utility that
    writes web admin forms, stored procedure code, and the
    functions (in ASP) that calls the sprocs that interface
    with the database.

    The widget works by simple lookups of information that
    I've entered to a database table - a very lame approach.
    Much better would be to interrogate the live database
    directly so as to return a recordset of field names and
    datatypes for a given table.

    Can someone advise me of the best/easiest way to make
    this happen?
    Guest

  2. Similar Questions and Discussions

    1. Select answer Without field names
      how can i get an answer from a select query without the column names first ? i can't understant how to use the option --skip-column-names ... ...
    2. Table field names not visible
      This morning I set up check in and check out to work on a site with someone else. Suddenly when looking at bindings details or any of the other...
    3. Get database field names from table...
      How do you get the database fieldnames from a table and display them using cfquery and cfoutput. Thanks a million...
    4. List Hash 'Field' Names
      I am trying to write more automated code - either I am a lazy typist or am just trying to get more with it! I have a hash I define; I have a form...
    5. List all and field names database contents
      I have been provided with a DSN, user name and password for one of my clients sites. I'm not an ASP developer and need to view all the contents...
  3. #2

    Default Re: interrogating database for field names/datatypes?

    You could query SQL Server's system tables, but they aren't guaranteed to
    stay the same between versions.

    You could use ADOX, even though it's COM based. It supports multiple
    databases too, so that might be a plus depending on your requirements.
    Here's more info on ADOX:
    [url]http://www.able-consulting.com/ADOX_Faq.htm#Q4[/url]
    [url]http://www.4guysfromrolla.com/webtech/013101-1.shtml[/url]
    Microsoft is working on new technologies that aren't COM based but they
    won't be released until the next major version of .NET.

    --
    I hope this helps,
    Steve C. Orr, MCSD
    [url]http://Steve.Orr.net[/url]


    <kennethfine@hotmail.com> wrote in message
    news:155401c35247$ec558890$a001280a@phx.gbl...
    >
    > I'm working primarily in ASP and transitioning to
    > ASP.NET. This is probably entered to the wrong group but
    > I'm not sure of what precise database technology I'm
    > referencing.
    >
    > I have written a decent little "codewriter" utility that
    > writes web admin forms, stored procedure code, and the
    > functions (in ASP) that calls the sprocs that interface
    > with the database.
    >
    > The widget works by simple lookups of information that
    > I've entered to a database table - a very lame approach.
    > Much better would be to interrogate the live database
    > directly so as to return a recordset of field names and
    > datatypes for a given table.
    >
    > Can someone advise me of the best/easiest way to make
    > this happen?

    Steve C. Orr, MCSD Guest

  4. #3

    Default RE: interrogating database for field names/datatypes?

    Hello,

    Please refer to the following articles:

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

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

    HTH.

    Best regards,
    Yanhong Huang
    Microsoft Online Partner Support

    Get Secure! - [url]www.microsoft.com/security[/url]
    This posting is provided "AS IS" with no warranties, and confers no rights.

    --------------------
    !Content-Class: urn:content-classes:message
    !From: <kennethfine@hotmail.com>
    !Sender: <kennethfine@hotmail.com>
    !Subject: interrogating database for field names/datatypes?
    !Date: Thu, 24 Jul 2003 17:58:55 -0700
    !Lines: 19
    !Message-ID: <155401c35247$ec558890$a001280a@phx.gbl>
    !MIME-Version: 1.0
    !Content-Type: text/plain;
    ! charset="iso-8859-1"
    !Content-Transfer-Encoding: 7bit
    !X-Newsreader: Microsoft CDO for Windows 2000
    !X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
    !Thread-Index: AcNSR+xVwyAzfYW9QSKsw1k9r1FeQQ==
    !Newsgroups: microsoft.public.dotnet.framework.aspnet
    !Path: cpmsftngxa06.phx.gbl
    !Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:161961
    !NNTP-Posting-Host: TK2MSFTNGXA08 10.40.1.160
    !X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    !
    !
    !I'm working primarily in ASP and transitioning to
    !ASP.NET. This is probably entered to the wrong group but
    !I'm not sure of what precise database technology I'm
    !referencing.
    !
    !I have written a decent little "codewriter" utility that
    !writes web admin forms, stored procedure code, and the
    !functions (in ASP) that calls the sprocs that interface
    !with the database.
    !
    !The widget works by simple lookups of information that
    !I've entered to a database table - a very lame approach.
    !Much better would be to interrogate the live database
    !directly so as to return a recordset of field names and
    !datatypes for a given table.
    !
    !Can someone advise me of the best/easiest way to make
    !this happen?
    !


    Yan-Hong Huang[MSFT] 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