CollectionName |
---|
MetaDataCollections |
DataSourceInformation |
DataTypes |
Restrictions |
ReservedWords |
Users |
Databases |
Tables |
Columns |
StructuredTypeMembers |
Views |
ViewColumns |
ProcedureParameters |
Procedures |
ForeignKeys |
IndexColumns |
Indexes |
UserDefinedTypes |
private DataTable GetSqlDatabaseSchema(string strConn, string collectionName,string[] strs)
{
SqlConnection connection = new SqlConnection(strConn);
DataTable schema = new DataTable();
try
{
connection.Open();
if (!string.IsNullOrEmpty(collectionName))
{
if (strs != null&&strs.Length >0)
{
schema = connection.GetSchema(collectionName, strs);
}
else
schema = connection.GetSchema(collectionName);
}
else
schema = connection.GetSchema();
}
catch
{
schema = null;
}
finally
{
connection.Close();
}
return schema;
}
本文转自today4king博客园博客,原文链接:http://www.cnblogs.com/jinzhao/archive/2009/07/29/1534023.html,如需转载请自行联系原作者