简体   繁体   English

如何使SQL Server连接(不是来自文件)出现在ADO.Net连接模型向导中?

[英]How to make SQL Server Connection (not from file) appear in ADO.Net Connection Model Wizard?

I am trying to add a connection to Adventureworks on a new development machine running VS 2010. I have SSMS running and am able to query the Adventureworks database. 我正在尝试在运行VS 2010的新开发计算机上添加与Adventureworks的连接。我正在运行SSMS,并且能够查询Adventureworks数据库。 However, when I click “New Connection” (steps followed below after *) , I do not see SQL Server connection as an option. 但是,当我单击“新建连接”(在*后面的以下步骤)时,我没有看到SQL Server连接作为选项。 Is there a way to configure VS 2010 so that it sees my localhost connection to SQL Server? 有没有一种方法可以配置VS 2010,以便它可以看到我的本地主机与SQL Server的连接?

Second option: When I try using the option Microsoft SQL Server from database file, whenever I browse to the mdf file for Adventureworks, I always see the message 'file in use', even though I have only one instance of VS 2010 open and SSMS is closed. 第二种选择:当我尝试使用数据库文件中的选项Microsoft SQL Server时,每当我浏览到Adventureworks的mdf文件时,即使我只有一个VS 2010打开和SSMS实例,我总是看到消息“文件正在使用”已关闭。

  • steps i followed were new project class library right click solution explorer add new item ado.net entity data management new connection 我遵循的步骤是新建项目类库,右键单击解决方案资源管理器,添加新项ado.net实体数据管理,新建连接

Just type in localhost as the server name, test the connection and click Ok. 只需输入localhost作为服务器名称,测试连接,然后单击“确定”。 It will be saved, next time it will appear in the list. 它将被保存,下次将出现在列表中。

  • The Data Source type is set to "Microsoft SQL Server (SqlClient)" 数据源类型设置为“ Microsoft SQL Server(SqlClient)”

If this doesn't pop up in your screen then install SQl Server Native Client here: http://msdn.microsoft.com/en-us/sqlserver/ff658533.aspx 如果您的屏幕上没有弹出此对话框,请在此处安装SQl Server Native Client: http : //msdn.microsoft.com/zh-cn/sqlserver/ff658533.aspx

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM