0

我在我的 C# Windows 应用程序中创建了一个本地数据库,并将数据插入到数据库中的一个表中。我的问题是为什么我在服务器资源管理器中查看表格时看不到表格中的数据?我看到 /bin/debug 文件夹中有一个数据库正在获取数据,但这不是服务器资源管理器中可用的数据库。Visual Studio 2010 中是否有设置使用项目数据库而不是调试版本?

4

2 回答 2

1

如果您打开 App.config,您可以将 connectionString 的数据源更改为指向您的数据库文件的直接链接。此外,在解决方案资源管理器中选择您的数据库,然后在“属性”部分将“复制到输出”属性更改为“不复制”

于 2013-04-18T14:33:41.330 回答
0

Exactly i think, you have two copy of your database.one in your bin folder and another in your server explorer(with different location).when you add data into table exactly you insert them into database at your bin folder(a copy of your database).

check your address of database in your connection string,it must be the same as address of your database in server explorer.(do you use EF?)

于 2013-04-07T04:51:19.023 回答