|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Is there a ADO.NET equivalent for ADOXI want to get a list of all the tables in a database then for each table,
all the columns, their datatypes, then views, indexes, etc. etc. The database may be of any technology - maybe only able to be connected by an ODBC connection (not just a SQL Server database). With VB6 and ADOX I can iterate through an ADOX.Catalog and do this. Yes, I could use Interop (ADOX) but I'm trying to be "pure" using only VS.NET 2005 so the question is "Is there an equivalent capability using native VS 2005?" Thanks for your help/advice I use GetOleDbSchemaTable to get this information ..
http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q309681 includes an example. If you are only using SqlServer you might be better off just to use the sprocs provided with it to access this data as I believe it would be a little bit faster than this method. Cheers, Greg Show quote "Sam Malone" <the_sam_mal***@hotmail.com> wrote in message news:O6zho19bGHA.2456@TK2MSFTNGP04.phx.gbl... >I want to get a list of all the tables in a database then for each table, >all the columns, their datatypes, then views, indexes, etc. etc. > The database may be of any technology - maybe only able to be connected by > an ODBC connection (not just a SQL Server database). > With VB6 and ADOX I can iterate through an ADOX.Catalog and do this. > Yes, I could use Interop (ADOX) but I'm trying to be "pure" using only > VS.NET 2005 so the question is "Is there an equivalent capability using > native VS 2005?" > > Thanks for your help/advice > Thanks very much (and thanks COR for your response too).
I'll try the docs/examples you guys have pointed to. Greg - No it isn't just SQL Server and that's the challenge. I want to be able to let a user pick a data source (e.g. a MySQL database via ODBC) and then be able to "get at" all those objects and their properties. I have no difficulty setting up the ODBC connection to read the "data". It's the meta-data that's challenging me. Show quote "Greg Young" <DruckDruckGo***@hotmail.com> wrote in message news:OzUbB$$bGHA.1208@TK2MSFTNGP04.phx.gbl... >I use GetOleDbSchemaTable to get this information .. >http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q309681 includes an >example. > > If you are only using SqlServer you might be better off just to use the > sprocs provided with it to access this data as I believe it would be a > little bit faster than this method. > > Cheers, > > Greg > "Sam Malone" <the_sam_mal***@hotmail.com> wrote in message > news:O6zho19bGHA.2456@TK2MSFTNGP04.phx.gbl... >>I want to get a list of all the tables in a database then for each table, >>all the columns, their datatypes, then views, indexes, etc. etc. >> The database may be of any technology - maybe only able to be connected >> by an ODBC connection (not just a SQL Server database). >> With VB6 and ADOX I can iterate through an ADOX.Catalog and do this. >> Yes, I could use Interop (ADOX) but I'm trying to be "pure" using only >> VS.NET 2005 so the question is "Is there an equivalent capability using >> native VS 2005?" >> >> Thanks for your help/advice >> > > Sam,
There is this namespace in how fare it is equal to the ADOX version is not known by me. http://msdn2.microsoft.com/en-us/library/system.data.oledb.oledbschemaguid_members.aspx A simple sample how to use one of those. http://www.vb-tips.com/default.aspx?ID=26f91edd-044c-4e71-8c6c-e9d7983c1e05 I hope this helps, Cor Show quote "Sam Malone" <the_sam_mal***@hotmail.com> schreef in bericht news:O6zho19bGHA.2456@TK2MSFTNGP04.phx.gbl... >I want to get a list of all the tables in a database then for each table, >all the columns, their datatypes, then views, indexes, etc. etc. > The database may be of any technology - maybe only able to be connected by > an ODBC connection (not just a SQL Server database). > With VB6 and ADOX I can iterate through an ADOX.Catalog and do this. > Yes, I could use Interop (ADOX) but I'm trying to be "pure" using only > VS.NET 2005 so the question is "Is there an equivalent capability using > native VS 2005?" > > Thanks for your help/advice > |
|||||||||||||||||||||||