473,385 Members | 1,769 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,385 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 1498
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...

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.