473,395 Members | 1,726 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,395 software developers and data experts.

Getting database info for SQL

Hi!

There is a way to obtain tables and fields info from an SQL connection. like
tables name, fields name, type and width ?

I'm writing a VB.NET application.

Thanks
Jul 21 '05 #1
3 1499
What DB are you using? If it's sql server you can use Information_Schema
and find out just about anything. if you fire a query and use a DataReader,
you can also use GetSchemaTable for instance to get most of what you want
regarding individual tables.

HTH,

BIll
"Sylvain Provencher" <sy****************@nobelia.com> wrote in message
news:uI**************@TK2MSFTNGP09.phx.gbl...
Hi!

There is a way to obtain tables and fields info from an SQL connection. like tables name, fields name, type and width ?

I'm writing a VB.NET application.

Thanks

Jul 21 '05 #2
Actually, I use MS SQL server. I don't use a data reader, but it can be a
way...

Can you send me code snippet if you have it ? Thanks!

"William Ryan" <do********@comcast.nospam.net> wrote in message
news:un**************@TK2MSFTNGP11.phx.gbl...
What DB are you using? If it's sql server you can use Information_Schema
and find out just about anything. if you fire a query and use a DataReader, you can also use GetSchemaTable for instance to get most of what you want
regarding individual tables.

Jul 21 '05 #3
DataTable dt = new DataTable();

dt = myDataReader.GetScehmaTable();

Querying Information_Schema can do a lot for you too, check out BOL, there's
a bunch of info in there.

HTH,

Bill
"Sylvain Provencher" <sy****************@nobelia.com> wrote in message
news:O5**************@tk2msftngp13.phx.gbl...
Actually, I use MS SQL server. I don't use a data reader, but it can be a
way...

Can you send me code snippet if you have it ? Thanks!

"William Ryan" <do********@comcast.nospam.net> wrote in message
news:un**************@TK2MSFTNGP11.phx.gbl...
What DB are you using? If it's sql server you can use Information_Schema and find out just about anything. if you fire a query and use a

DataReader,
you can also use GetSchemaTable for instance to get most of what you want regarding individual tables.


Jul 21 '05 #4

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

Similar topics

3
by: James | last post by:
Please help - getting very desperate! Sun, 12 October 2003 05:39 I have PHPDEV 4.2.3 from Firepages.com.au as the upgrade to 4.3.0 did not work. I also had an abortive download from PHP.NET as...
2
by: Timo J | last post by:
Hi - Im sitting and trying to understand this OOP - and need to create a class wich can do the following.. ShowBlocks() - Displays the data wich is inside it - If empty creates a form wich sends...
0
by: Buddy Ackerman | last post by:
I have an application where the client wants AD integration. The application requires that the user accounts reside in the app's database. The application is a (.NET) webservices based app where...
1
by: Oleg Shnayderman | last post by:
Hi All, I am very new to C# as well as to SQL. I need to write an application which is connecting to SQL DB and getting all the user's tables and after create a dataset for all the tables in the...
5
by: Brian Henry | last post by:
I have a page which reads an article from the database it has 1 text box, 2 dropdown lists, and a longreat HTML text box. I load the information from the database when the page is set to edit mode...
0
by: JT | last post by:
I have a web page that I want for the user to be able to enter their Name, address, Phone number, email, and comments and then click submit. I created a database with fields corresponding to the...
2
by: David Hearn | last post by:
Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. Description: An unhandled exception occurred during the execution of the current...
3
by: h4xPace | last post by:
I am building a MySQL query application, and I have run into a small snag. MySQL has released a set of classes that extend the .NET framework base data classes (command, connection, etc), and I am...
2
by: sesling | last post by:
Our Database stores event messages in a table called eventnotifications. The table has a message type column. There are two types of messages (alert or info). I have created a form that includes a...
2
by: rustyc | last post by:
Well, here's my first post in this forum (other than saying 'HI' over in the hi forum ;-) As I said over there: ... for a little side project at home, I'm writing a ham radio web site in...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.