473,396 Members | 1,987 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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?
Nov 17 '05 #1
2 1940
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
<ke*********@hotmail.com> wrote in message
news:15****************************@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?

Nov 17 '05 #2
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?
!
Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: David Thompson | last post by:
Looking for a book to help me develop a philosophy for building databases (particularly on MySQL). And then taking them from concept to construction. Something like.... Start by asking which...
1
by: Craig | last post by:
Hi, I am storing information being sent to me weekly into a ms sql database. The one twist I am running into is that later down the line the information I recieve may require more columns, or...
0
by: Rob Young | last post by:
This is the latest in the "Total Non-Programmer" series. Any feedback on the usability of this tutorial would be greatly appreciated. Thanks, Rob How to Build A Web Database (Without...
4
by: Josué Maldonado | last post by:
Hello list, First of all, excuse me if this is not the right place to ask my question. Is there a way in postgresql to loop to all the fields of a given table and compare the OLD and NEW...
14
by: Mickey | last post by:
I have a database in which I have 2 tables. One table is Employees, other is Events. I have only one field in Employees and it is EmployeeName (text 50 chars). Events has fields AutoNumber,...
7
by: Coral G via AccessMonster.com | last post by:
Using Access 2000 I need to truncate the last few characters of a string based on the presence of a dash (-). This dash is not always present and can be followed by a variable number of numbers...
4
by: Shabs | last post by:
Hi, We are having this problem here on our project where we store all firstnames, lastnames in the oracle database in uppercase, when we retrieve the data to be used in web application and...
29
by: MP | last post by:
Greets, context: vb6/ado/.mdb/jet 4.0 (no access)/sql beginning learner, first database, planning stages (I think the underlying question here is whether to normalize or not to normalize this...
0
by: jonathan.beckett | last post by:
Hi all, I thought this might be handy for others at some point, so here it is... a bit of code to output all the table names, field names and datatypes from a MySQL database. I just had to do it...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.