Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
I have developed a simple WPF application in visual studio 2010.
 
Then i created it's setup. Steps to build setup are as follow:
1)Created a new project for deployment(Named Setup1).
2)Then i copied all files from the Bin folder of my WPF application and Pasted all files in Application Folder of deployment project.
3)Build Setup1.
4)Then i install the Setup1.msi (That was in Bin folder of Setup1 deployment project).
*****************************************************
After installation of Setup1.
 
1)I can retreive the database from database.
2)But it generate exception Exception:Failde to update the database "database name" because database is read only. When i try to insert data into the database.
******************************************************
My connection string is:
string connectionString = @"Data Source=.\SQLEXPRESS;AttachDbFilename="+Directory.GetCurrentDirectory().ToString()+
@"\tryDatabase.mdf;Integrated Security=True;User Instance=True";
 
How can i solve this problem?
Posted 15-Sep-12 3:38am
Edited 15-Sep-12 3:40am
(no name)105.8K
v2
Comments
Kenneth Haugland at 15-Sep-12 8:40am
   
Did it work in debug?
footballpardeep at 15-Sep-12 8:42am
   
Yes it is working correctly in visual studio correctly.
Wes Aday at 15-Sep-12 8:59am
   
I know, obvious, but have you considered making the database not read only?
footballpardeep at 15-Sep-12 9:09am
   
I don't know the steps you are talking about.
I followed these steps to create database in VS 2010:
1)Project->Add New Item->Service Base Database> Next ->Next...Finish.
 
2)I also check the permissions of the database by right clicking on the database,they are fine.
footballpardeep at 15-Sep-12 10:06am
   
Problem partially solved:
It's working when i install my software in other drive which don't have window installed.
Please tell me , how will it work if i want to install it in c: drive.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 200
1 George Jonsson 175
2 Kornfeld Eliyahu Peter 169
3 PIEBALDconsult 110
4 Richard MacCutchan 85
0 OriginalGriff 6,080
1 DamithSL 4,648
2 Maciej Los 4,087
3 Kornfeld Eliyahu Peter 3,624
4 Sergey Alexandrovich Kryukov 3,294


Advertise | Privacy | Mobile
Web03 | 2.8.141220.1 | Last Updated 15 Sep 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100