简体   繁体   中英

C# application with database works fine but after deploy doesn't work

I created ac# application with database and everything works perfect in Visual Studio , I can read , insert and delete from database ,but after i deploy my application i can read ,but can't insert and delete. When i try to insert or delete my application show catch error. In Visual Studio everything works perfect ,but when i deploy and install application i have this problem. I deployed my application with Setup Project and in my application folder i added all files from debug folder.

And here is my connection string:

Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\Baza-de-date.mdf;Integrated Security=True"

I'm using VS 2013 and Microsoft SQL Server

Thanks in advance and sorry for my English.

You must check following Item:

  • The name of operational database was equal to name of develop database.
  • User name and password that used in develop equal to User Name and password that used in operational database.
  • Your User name have enough permission.
  • Assigned folder exists and .mdf file not in read only mode.
  • you have enough permission for this folder.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM