如何查找数据库的最后修改日期和时间 table

How to find the last modifed date and time of a database table

我已经到了连接打开并能够显示数据库名称的地步...

using (SqlConnection connection = new SqlConnection("connectionstring_here"))
            {
            try    
            {

            connection.Open();
            DBname.Text=connection.Database;

            } 
            catch (Exception) 
            { 
            /*Handle error*/ 
            }
            }

我在 MSDN 上看到有这个 "table" class 并且它的最后修改日期是 tb.DateLastModified.ToString()

给定我要去的地方,我该如何到达那里?

它是 SQL 个服务器管理对象。

  1. 添加项目引用
  2. 浏览到 C:\Program Files\Microsoft SQL Server0\SDK\Assemblies\
  3. 添加对 Microsoft.SqlServer.Smo
  4. 的引用

您现在应该能够遵循 MSDN 指南并使用 table 对象。