LocalDB:如何删除它? [英] LocalDB: How do you delete it?

查看:123
本文介绍了LocalDB:如何删除它?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

设置:首先将实体框架代码添加到新数据库中.

Setup: Entity framework code first to new database.

场景:我正在使用EF,并向数据库中添加了一堆元素.然后,我更改了实体模型,虽然我知道我可以进行迁移,但我只是想从头开始,基本上是从大地上擦除数据库.

Scenario: I'm playing around with EF and I add a bunch of elements to my database. I then change the entity model, and while I know that I could do migrations, I just want to start from scratch and basically wipe the database from the earth.

默认使用的数据库为(localdb)\ v11.0.

The database used by default was (localdb)\v11.0.

我的问题是:

我可以去某个地方删除文件,还是启动某种管理器删除该数据库并从头开始?

Can I go somewhere and just delete a file, or start some kind of manager to delete that database and start from scratch?

推荐答案

只需进入具有管理员权限的命令提示符,然后输入:

Just go in command prompt with admin rights and type:

//list the instancies
sqllocaldb i

//stop selected instance
sqllocaldb p "selected instance"

//delete
sqllocaldb d "selected instance"

//recreate or create new one 
sqllocaldb c "new instance"

这篇关于LocalDB:如何删除它?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆