Visual Studio 2010 无法添加引用,因为它无法连接到 SQL Server
我对 Visual Studio 还很陌生,所以这可能是一个简单的问题:)
我创建了一个 Visual C# SQL CLR 数据库项目,在其中创建了一个触发器。该触发器应该访问网络中另一台计算机上的 IIS。为了做到这一点,我发现我需要 System.DirectoryServices,但是当我添加这个 VS 时,我抱怨我需要一个程序集。然后我发现我应该在 MS SQL SERVER 中运行 CREATE ASSEMBLY。是否成功并成功将我的数据库添加为数据连接(服务器资源管理器 -> 数据连接)。在 Assemblies 子文件夹中,我可以看到 System.DirectoryServices,但无法从添加引用...(在解决方案资源管理器中右键单击引用时)引用它。尝试添加引用时,我有两个选项卡:“项目”(空)和“SQL Server”,这会出现以下错误:
由于以下原因,与数据库的连接失败:有 没有可用的 SQL 服务器连接。
目前无法添加服务器引用,但您可以继续 开发该项目。
当我尝试将服务器连接添加到本地主机或我的计算机的计算机名称时,它似乎没有执行任何操作(没有错误,但服务器资源管理器中也没有添加服务器)。
I'm pretty new to Visual Studio so this might be an easy issue :)
I have created a Visual C# SQL CLR Database project where I have created a Trigger. This trigger is supposed to access an IIS on another machine in the network. In order to do this I found that I needed System.DirectoryServices but when I added this VS complained that I needed an assembly. Then I found that I should run the CREATE ASSEMBLY in the MS SQL SERVER. Did that successfully and successfully added my database as a data connection (Server Explorer -> Data Connections). In the Assemblies subfolder I can see the System.DirectoryServices but cannot reference it from the add reference... (when right-clicking references in the solution explorer). When trying to add a reference I have two tabs: Projects (empty) and SQL Server which gives the following error:
The connection to the database failed for the following reason: There
is no available SQL server connection.No server references can be added at this time, but you may continue
to develop the project.
When I try to add a server connection to either localhost or the machine name of my computer it seems to do nothing (no error but also no server is added in the server explorer).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在解决方案资源管理器中,右键单击项目并选择“属性”。选择右侧的“数据库”选项卡,然后浏览到您的数据库或插入连接字符串。
In Solution Explorer, right click on the Project and select 'Properties'. Select 'Database' tab on the right hand side, then browse to your database or insert a connection string.