.NET读取数据库说明信息
首先,添加引用:
Microsoft.SqlServer.Management.Smo
Microsoft.SqlServer.ConnectionInfo
然后创建数据库集合对象
public static string ReturnMemoInfo
{
Server srv = new Server(srvname);
Microsoft.SqlServer.Management.Smo.DatabaseCollection dbc= srv.DataBases;
return dbc["DB_Name"].Tables["Table_Name"].Columns["Column_Name"].ExtendedProperties[0].Value.ToString();
}
Microsoft.SqlServer.Management.Smo
Microsoft.SqlServer.ConnectionInfo
然后创建数据库集合对象
public static string ReturnMemoInfo
{
Server srv = new Server(srvname);
Microsoft.SqlServer.Management.Smo.DatabaseCollection dbc= srv.DataBases;
return dbc["DB_Name"].Tables["Table_Name"].Columns["Column_Name"].ExtendedProperties[0].Value.ToString();
}