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: <ke*********@hotmail.com>
!Sender: <ke*********@hotmail.com>
!Subject: interrogating database for field names/datatypes?
!Date: Thu, 24 Jul 2003 17:58:55 -0700
!Lines: 19
!Message-ID: <15****************************@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?
!