我的数据库在Visual Studio 2010中在哪里? [英] Where is my database in Visual Studio 2010?

查看:162
本文介绍了我的数据库在Visual Studio 2010中在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Visual Studio 2010 Professional在(C#)ASP.NET MVC3中创建我的第一个项目,我正在创建一个非常基本的博客系统。在测试期间,我创建了一些表,现在我想在这些表上存储不同的数据,但是我不断收到此错误:

I'm creating my first project in (C#) ASP.NET MVC3 using Visual Studio 2010 Professional, I'm creating a very basic blog system. During the tests I created a some tables and now I want do store different data on those tables but I keep getting this error:

模型支持自创建数据库以来, CategoryContext上下文已更改。手动删除/更新数据库,或使用IDatabaseInitializer实例调用Database.SetInitializer。例如,DropCreateDatabaseIfModelChanges策略将自动删除并重新创建数据库,并有选择地将新数据作为种子。

很明显,我需要更新数据库中的表,但找不到在哪里可以访问表。我可以使用CTRL + ALT + S打开Server Explorer,但是那里没有数据库或表。

Obviously I need to update the tables in database but I can't find where I can access the tables. I can open Server Explorer using CTRL+ALT+S but there is no Database or tables there.

以下是它的屏幕截图:


http://img710.imageshack.us/img710/8944/screenshot001kd.png

我在哪里/如何找到和/或编辑实际的数据库表?

Where/how can I find and/or edit the actual database tables?

谢谢。

推荐答案

以下是我能为您做的最好的事情:

Well here is the best I can do for you:

如果使用SQL Compact Edition,则应查看项目文件夹

If using SQL Compact Edition then you should look into your project folder on the filesystem and look for a folder called app_data and you should have a database in there.

另一种方法是,您可以打开web.config文件,然后查找该部分。是 ConnectionStrings部分,只需查找数据库的位置。

Alternativly you could just open your web.config file and look for the section that is the "ConnectionStrings" section and just look for the location of the database.

如果在SQL Server Express中,则n在数据库资源管理器窗口中,单击数据库连接,然后创建到本地sql server express的连接。您应该在数据库列表中以计算机名称\sqlexpress看到它。

If it is in SQL Server Express, then in your Database Explorer window, click on the database connections and create a connection to your local sql server express. You should see it in the list of databases as the machinename\sqlexpress.

这篇关于我的数据库在Visual Studio 2010中在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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