I\'ve searched through a bunch of websites and I have not come across any code or tutorial which has gone through the specifics of obtaining the table names from a single da
if you are asking about .net code then You need SMO :
using Microsoft.SqlServer.Management.Smo;
using Microsoft.SqlServer.Management.Common;
public static List GetTables(string connection, string databaseName)
{
if (String.IsNullOrEmpty(connection))
throw new ArgumentException("connection is null or empty.", "connection");
Server srv = getServer(connection);
return srv.Databases[databaseName].Tables.Cast().ToList();
}
- 热议问题