且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何将SQL Server Express数据库连接到VS 2017

更新时间:2022-11-24 20:08:36

弄清楚了我的问题: 在Visual Studio的添加新数据源"向导中,我一直选择的选项是"Microsoft SQL Server数据库文件",因为其描述是使用此选择将数据库文件附加到本地Microsoft SQL Server实例(包括Microsoft SQL Express) )使用适用于SQL Server的.NET Framework数据提供程序."

Figured out my issue: in Visual Studio's "Add New Data Source" wizard, the option I kept choosing was "Microsoft SQL Server Database File", because its description is "Use this selection to attach a database file to a local Microsoft SQL Server instance (including Microsoft SQL Express) using the .NET Framework Data Provider for SQL Server."

但是,我不确定为什么,这不是正确的选择.

However, and I'm not sure why, this was not the right selection.

我尝试选择其他".

然后在下一页上输入.\ SQLExpress"作为服务器名称(在connectionstrings.com/sql-server/上提到...感谢潜在客户@ ryguy72!)

Then on the next page input ".\SQLExpress" as the Server Name (mentioned on connectionstrings.com/sql-server/ ...Thanks for the lead @ryguy72!)

然后,在连接到数据库"下,弹出我的本地数据库列表,包括我已经使用SSMS创建的数据库列表.

Then, under "Connect to a database" my local list of databases popped up, including the one I had created already using SSMS.

然后,测试连接终于可以工作了!

Test Connection finally worked then!