简体   繁体   English

在Visual Studio中使用数据连接来探索SQL Server Express数据库

[英]Using data connections in Visual Studio to explore SQL Server Express database

I am using Entity Framework in order to create my models, but when I try to access the database from the data connections in Server Explorer, it does not work. 我正在使用实体框架来创建我的模型,但是当我尝试从Server Explorer中的数据连接访问数据库时,它不起作用。 I know the models are being created in the SQL Server Express instance running on my local machine, as I navigated to 我知道在导航到本地计算机上的SQL Server Express实例中正在创建模型时

Computer -> Program Files -> Microsoft SQL Server -> MSSQL10.SQLEXPRESS -> MSSQL -> DATA ->

and the database is in there. 数据库在那里。

在此处输入图片说明

Shouldn't my local instance of SQL Server Express show up in this window? 我的SQL Server Express本地实例不显示在此窗口中吗?

在此处输入图片说明

I read over this article from Microsoft which explains where database is stored. 我从Microsoft阅读了这篇文章,其中解释了数据库的存储位置。

Under server name type in \\\\\\SQLEXPRESS or .\\SQLEXPRESS (assuming you have installed the instance with default values) 在服务器名称下,键入\\\\\\SQLEXPRESS.\\SQLEXPRESS (假设您已使用默认值安装实例)

then you should be able to access the database from the dropdown list. 那么您应该能够从下拉列表访问数据库。

you need to select your machine name from the Server Name dropdown as shown in below picture. 您需要从“ Server Name下拉列表中选择计算机名称,如下图所示。

在此处输入图片说明

if your server is not showing in the list then simply open SQL Server note down that Server Name and write it Manually. 如果您的服务器未显示在列表中,则只需打开SQL Server,记下该“ Server Name并手动编写即可。

Here is an Example 这是一个例子

在此处输入图片说明

在此处输入图片说明

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

相关问题 无法从Visual Studio Express 2012创建SQL Server数据库 - Unable to create SQL Server database from Visual Studio Express 2012 在Visual Studio中使用SQL Server中的数据库 - Using Database from SQL Server in Visual Studio 如何在Visual Studio中添加SQL Server数据库文件(.mdf)而不安装SQL Server Express Edition? - How to add SQL Server database file (.mdf) in Visual Studio without installing SQL Server Express Edition? 从Visual Studio连接到SQL Server Express - Connecting to SQL Server Express from Visual Studio 从Visual Studio连接到SQL Server Express - Connection to SQL Server Express from Visual Studio 使用Visual Studio 2010连接到SQL Server Express - Connection to sql server express with visual studio 2010 通过 DataGridView 将数据插入 SQL 服务器数据库在 Visual Studio 中不起作用 - Inserting Data Into SQL Server Database Through DataGridView Not Working In Visual Studio 使用Visual Studio远程连接到SQL Server数据库 - Remote connection to SQL Server database using Visual Studio 使用LINQPad后,Visual Studio中的SQL Server数据库出现错误 - Error with SQL Server database in Visual Studio after using LINQPad 使用Visual Studio 2017在SQL数据库中插入数据 - Insert data in SQL Database using Visual Studio 2017
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM