|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How to get meta data info in ADO.NETWe are developing a Windows Form application that try to retrieve the Database Schema from MS SQL Server and Oracle. The application is developing under Visual Studio .NET 2005 with the use of Schema API from ADO.NET 2.0. With the use GetSchema() method of SQLConnection and OracleConnection, we can successfully retrieve all the tables and columns from the database. But we got the following difficulities during the retrieve of database schema: 1. How can i identify which columns are primary key or foreign key? 2. Can we retrieve the reference of foreign key (e.g, which column of which table are bing referenced by a foreign key)? 2. Can we retrieve the relations between tables? 3. Is it necessary to install Oracle Client for the use of OracleConnection within ADO.NET 2.0? We are looking forward to your favorable reply. Best Regards CeCIDer
Have a look at this page at our website, there is as well information for OleDB and MySQL be aware that this kind of information is for every server different. http://www.vb-tips.com/default.aspx?ID=9e2d9af4-3909-421d-b422-87c1d376674d I hope this helps, Cor Did you try Connection.GetSchema?
-- Show quote____________________________________ William (Bill) Vaughn Author, Mentor, Consultant Microsoft MVP INETA Speaker www.betav.com/blog/billva www.betav.com Please reply only to the newsgroup so that others can benefit. This posting is provided "AS IS" with no warranties, and confers no rights. __________________________________ "CECIDer" <CECI***@discussions.microsoft.com> wrote in message news:3F675963-6381-4D80-8013-F6C1261862F6@microsoft.com... > Hi, > > We are developing a Windows Form application that try to retrieve the > Database Schema from MS SQL Server and Oracle. The application is > developing > under Visual Studio .NET 2005 with the use of Schema API from ADO.NET 2.0. > With the use GetSchema() method of SQLConnection and OracleConnection, we > can successfully retrieve all the tables and columns from the database. > But > we > got the following difficulities during the retrieve of database schema: > > 1. How can i identify which columns are primary key or foreign key? > > 2. Can we retrieve the reference of foreign key (e.g, which column of > which > table are bing referenced by a foreign key)? > > 2. Can we retrieve the relations between tables? > > 3. Is it necessary to install Oracle Client for the use of > OracleConnection > within ADO.NET 2.0? > > We are looking forward to your favorable reply. > > Best Regards > |
|||||||||||||||||||||||