interrogating database for field names/datatypes?

Discussion in 'ASP .Net' started by Guest, Jul 25, 2003.

  1. Guest

    Guest Guest

    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, Jul 25, 2003
    #1
    1. Advertising

  2. 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:
    http://www.able-consulting.com/ADOX_Faq.htm#Q4
    http://www.4guysfromrolla.com/webtech/013101-1.shtml
    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
    http://Steve.Orr.net


    <> wrote in message
    news:155401c35247$ec558890$...
    >
    > 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, Jul 25, 2003
    #2
    1. Advertising

  3. Hello,

    Please refer to the following articles:

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

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

    HTH.

    Best regards,
    Yanhong Huang
    Microsoft Online Partner Support

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

    --------------------
    !Content-Class: urn:content-classes:message
    !From: <>
    !Sender: <>
    !Subject: interrogating database for field names/datatypes?
    !Date: Thu, 24 Jul 2003 17:58:55 -0700
    !Lines: 19
    !Message-ID: <155401c35247$ec558890$>
    !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], Jul 28, 2003
    #3
    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. Bob
    Replies:
    1
    Views:
    394
    Lucas Tam
    Jul 30, 2004
  2. Andrew Banks

    List all and field names database contents

    Andrew Banks, Jul 15, 2003, in forum: ASP General
    Replies:
    2
    Views:
    122
    Aaron Bertrand - MVP
    Jul 15, 2003
  3. Ken Fine
    Replies:
    2
    Views:
    204
    Ken Fine
    Feb 5, 2004
  4. Sound
    Replies:
    2
    Views:
    465
    Randy Webb
    Sep 28, 2006
  5. jr
    Replies:
    3
    Views:
    448
Loading...

Share This Page