mysql对象资源管理器,SQL Server对象资源管理器不显示数据库

It's a very small code-first EF6 Project. I added a migration and updated a database successfully. Here's the output:

PM> update-database -Verbose

Using StartUp project 'ChattyServer'.

Using NuGet project 'ChattyDataModel'.

Target database is: 'ChattyDataModel.ChattyContext' (DataSource: .\SQLEXPRESS, Provider: System.Data.SqlClient, Origin: Convention).

No pending explicit migrations.

Running Seed method.

However, when I open the SQL Server Object Explorer, I can't find my database:

VYbRw.png

UPD: The app.config - which connection string should I use for LocalDb?

type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />

UPD: Updated the app.config, added:

connectionString="Data Source=(localdb)\ProjectsV13;Initial Catalog=master;Integrated Security=True;ConnectTimeout=30;Encrypt=False;TrustServerCertificate=True;ApplicationIntent=ReadWrite;MultiSubnetFailover=False" />

Then created a new migration and updated a database. No changes in the SQL Server Object Explorer

UPD I changed the directory from master to chatty, created a new migration and updated the db-still can't see db in the SQL Server Object Explorer

解决方案

Firstly: You are using the Master database. Check this post to know how to set your connection string: Cant find my EF code first database.

Secondly: You didn't connect to SQLEXPRESS:

In your Server Explorer click on Connect to Database.

Then in the Server name type .\sqlexpress

Then Test Connection.

then in the Select or enter a database name you should get your

database.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值