在运行应用程序(.exe)时创建设置文件后出错 [英] Error after Creation of set up file while running application(.exe)

查看:93
本文介绍了在运行应用程序(.exe)时创建设置文件后出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建并安装了安装程序,但是在安装后运行应用程序(.exe)时出现错误您的应用程序中出现未处理的异常.如果单击继续,应用程序将忽略此错误并尝试继续.如果单击退出",则应用程序将立即关闭.尝试附加自动命名的数据库文件"C:\ User \ Desktop \ CarRent.mdf"失败.存在具有相同名称的数据库或无法打开指定文件,或者位于UNC共享上."帮助我解决了这个问题.希望尽快找到您.谢谢.

I have created setup and installed it but after installation when I run the application(.exe) It gives error "Unhandled exception has occurred in your application .If you click continue,the application will ignore this error & attempt to continue.If you click Quit,the application will close immediately.An attempt to attach an auto named database file "C:\User\Desktop\CarRent.mdf" failed.A database with same name exists or specified file cannot be opened,or it is located On UNC Share".Help me to solve this problem .Looking for favorable soon.Thank You.

推荐答案

1.尝试将数据库放入应用程序的App_Data文件夹中.
2.如果这不起作用,那么如果您是通过sql server management studio express创建数据库的,那么请尝试使用下面的此连接字符串.
数据源=.\ SQLEXPRESS;初始目录= CarRent;集成安全性= True
3.即使所有这些无助于尝试从sql server中删除已存在的数据库,但也请进行备份,因此,当没有附加的数据库时,它将绝对可以正常工作.
1. Try to put your data base in application''s App_Data folder.
2. If this doesn''t work than try to use this connection string below, if you created database by sql server management studio express.
Data Source=.\SQLEXPRESS;Initial Catalog=CarRent;Integrated Security=True
3. Even if all this doesn''t help than try to delete already existed database from sql server but please take a backup,So when there is no attached database,It''ll work fine absolutely.


这篇关于在运行应用程序(.exe)时创建设置文件后出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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