我为Windows应用程序项目创建了一个安装文件,我得到了错误帮助 [英] I create a setup file for my windows application project,I got the error help me

查看:73
本文介绍了我为Windows应用程序项目创建了一个安装文件,我得到了错误帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

显示该错误

Error showing that

"unhandled exception has occured in your application.if you click continue,the application will ignore this error and attempt to continue.if you click quit.the application will close immediately"
"failed to update database "c:\programfiles(x86)\default company name\setup1\new.mdf"

,因为数据库是只读的



我不知道这是怎么发生的,请有人帮帮我.


我的项目在Visual Studio 2008上运行良好,可以插入,检索数据.

但是我安装了我的安装文件,然后访问了该文件,因为显示了错误,所以我无法插入值.


1)如何使用数据库设置Windows应用程序项目


我从Visual Studio 2008创建数据库->添加新项目->基于服务的数据库

我的数据库名称是New

我的数据库出现在我的项目文件夹中

这是我的连接字符串

because the database is read only



i dont know how it happen like this,someone pls help me.


my project has working well on visual studio 2008,i can insert,retrieve datas.

but i installed my setup file then i access into it i cannot insert values because the error showed.


1)how could setup a windows application project with database


i create my database from visual studio 2008->add new item->service based database

my database name is New

my database is occure inside my project folder

this is my connection string

Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\New.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True



[edit] SHOUTING已删除-OriginalGriff [/edit]



[edit]SHOUTING removed - OriginalGriff[/edit]

推荐答案

1.您只需在程序文件文件夹中的数据库上单击鼠标右键,然后选择属性.在其中,取消选中readonly属性.这应该够了吧.

2.避免保留作为关键字的Db名称. "New"也不是一个有意义的名称.

3.要在设置中包含数据库,请查看以下内容:
创建设置并支持使用VS.NET创建数据库 [在安装.NET应用程序期间创建数据库 [部署您的应用程序和数据库 [
1. You can simply right click the database in program files folder and select properties. In it, uncheck the readonly property. That should do the trick.

2. Avoid keeping names of Db that are keywords. Nor does ''New'' is a meaningful name.

3. For including database in setup, have a look at these:
Creating setup With support for database creation Using VS.NET[^]
Create database during installation of a .NET application [^]
Deploy your Application and Database[^]


这篇关于我为Windows应用程序项目创建了一个安装文件,我得到了错误帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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