[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

FredericP

4/30/2002 11:46:00 AM

Hello happy developpers,

How can i make a SQLColumns to get name and info about columns with ODBC.
NET ?


5 Answers

(Hussein Abuthuraya(MSFT))

4/30/2002 11:32:00 PM

0

FredericP

5/13/2002 4:36:00 PM

0

Hussein,

Thank's very much for your answer, but how can i obtain the list of tables
in my DSN (same as SQLTables)

Thank's by advance


"Hussein Abuthuraya(MSFT)" <HussAbOnline@microsoft.com> a écrit dans le
message de news: nirxW6I8BHA.1248@cpmsftngxa08...
> Frederic,
>
> Filling a DataSet using the OdbcDataAdapter, will gets you the basic
Columns information for all columns in the Select statement. To Add primary
key
> information and column constraints, you need to use FillSchema method of
the DataAdapter. If you need only PK info, then use DataAdapter's
> MissingSchemaAction property and set it to AddWithKey.
>
>
> Thanks,
> Hussein Abuthuraya
> Microsoft Developer Support
>
> This posting is provided "AS IS" with no warranties, and confers no
rights. You assume all risk for your use. © 2002 Microsoft Corporation. All
rights reserved
>
> Are you secure? For information about the Microsoft Strategic Technology
Protection Program and to order your FREE Security Tool Kit, please visit
> http://www.microsoft.co....
>


(Hussein Abuthuraya(MSFT))

5/14/2002 12:39:00 AM

0

Mahmoud S. Khater

5/16/2002 4:51:00 AM

0

can i use this solution if the DSN refers to any DB or must it be on
SQLServer only??????

--
Sincerely,
Mahmoud S. Khater
mskhater@computer.org
"Hussein Abuthuraya(MSFT)" <HussAbOnline@microsoft.com> wrote in message
news:eIR3Q8s#BHA.1956@cpmsftngxa07...
> OK to get a list of tables in a specific Database, you need to run a TSQL
command that gets you this. Here is a sample code:
>
> Dim nwindConn As OdbcConnection = New
OdbcConnection("dsn=NwindSqlODBC;uid=sa;pwd=")
> Dim salesCMD As OdbcCommand = New OdbcCommand("select * from
Sysobjects where type='U'", nwindConn)
> salesCMD.CommandType = CommandType.Text
> nwindConn.Open()
> Dim myReader As OdbcDataReader
> myReader = salesCMD.ExecuteReader()
> While myReader.Read
> Console.Write(myReader("name") & vbNewLine)
> End While
> myReader.Close()
> nwindConn.Close()
>
> I hope this helps!
>
>
> Thanks,
> Hussein Abuthuraya
> Microsoft Developer Support
>
> This posting is provided "AS IS" with no warranties, and confers no
rights.
>
> Are you secure? For information about the Microsoft Strategic Technology
Protection Program and to order your FREE Security Tool Kit, please visit
> http://www.microsoft.co....
>


(Hussein Abuthuraya(MSFT))

5/16/2002 8:18:00 PM

0