本文介绍了找不到Microsoft.SqlServer.ConnectionInfo.dll程序集文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图仅使用C#代码来动态获取数据库表结构,如下所示:

I'm trying to dynamically get a databases Table structure using only C# code as follows:

using Microsoft.SqlServer.Management.Common;
using Microsoft.SqlServer.Management.Smo;

public class LoadStuff
{
    ...
    public void LoadDatabase(string vDatabaseName)
    {
        using (var vSqlConnection = new SqlConnection(DatabaseConnectionString))
        {
            var vConnection = new ServerConnection(vSqlConnection);
            var vServer = new Server(vConnection);
            var vDatabase = vServer.Databases[vDatabaseName];
            var vTables = vDatabase.Tables;
        }
    }
}

但是,我也找不到.dll文件来添加引用.我正在使用Visual Studio 2010专业版.有什么建议吗?

However, I cannot find the .dll file to add a reference too. I'm using Visual Studio 2010 Professional. Any suggestions?

推荐答案

它位于我计算机上的c:\ program files \ microsoft sql server \ xxx \ sdk \ assemblys中.其中xxx是SQL Server版本号(90或100).不确定如何到达那里.

It is located in c:\program files\microsoft sql server\xxx\sdk\assemblies on my machine. Where xxx is the SQL Server version number (90 or 100). Not sure how it got there.

这篇关于找不到Microsoft.SqlServer.ConnectionInfo.dll程序集文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-06 15:55