fundsf
asked on
Getting the Database schema using Microsoft.Practices.EnterpriseLibrary.Data
Hello,
I need to get the Database schema information using Microsoft.Practices.Enterp riseLibrar y.Data. I have not found a means to do this with these tools. I found an article using ADO.Net OpenSchema, but I do not want to add multiple database connections to my application.
Does anyone know how to gain access to this information? I use selects to tables and stored procedure/queries in SQL Server and MS Access. The type of information that I need to derive is the column name, column data type, column size (length), column precision, column scale, column order (ordinal), is the column null able, is the column part of the primary key, is the column part of an index, is the column for replication or not for replication, is the column a GIUD and is the column an identity or the equivalent.
Thank in advance for any help.
I need to get the Database schema information using Microsoft.Practices.Enterp
Does anyone know how to gain access to this information? I use selects to tables and stored procedure/queries in SQL Server and MS Access. The type of information that I need to derive is the column name, column data type, column size (length), column precision, column scale, column order (ordinal), is the column null able, is the column part of the primary key, is the column part of an index, is the column for replication or not for replication, is the column a GIUD and is the column an identity or the equivalent.
Thank in advance for any help.
ASKER
Correct, but looking into the net, I found that you could use the ADODB OpenSchema to get the info from SQL Server, Access or oracle. I cannot find a simular solution for the Microsoft.Practices.Enterp riseLibrar y.Data that Microsft now provides.
I also found a DAO example, but I would rather not have two difference means of getting this information.
I also found a DAO example, but I would rather not have two difference means of getting this information.
Try using the INFORMATION_SCHEMA views (look at BOL for deatils)
SELECT * FROM myDB.INFORMATION_SCHEMA.CO LUMNS WHERE TABLE_NAME = 'myTable'
SELECT * FROM myDB.INFORMATION_SCHEMA.CO
I guess that doesn't address your desire to have a single process for all datasources. I've used the ADO DataAdapter.FillSchema method in the past maybe that will work.
ASKER
Can you give me an example of using the ADO DataAdapter.FillSchema while using the Microsoft.Practices.Enterp riseLibrar y.Data stuff? If so, and I can get it to work , you will win the points.
ASKER
Also, is the ADO a ADO.Net colution? I would ranther not intorduce COM objects into the code base.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Open in new window