how to deploy a window application with a database which can be updated!

selom86

New member
Joined
Jul 21, 2009
Messages
1
Programming Experience
Beginner
hi, i'm not very good at deployment and i'm facing a problem:

First Off, im using Vista.
i have created a windows application in vb.net which has a database file named Customerdb.mdf in it.
I have selected the database and in the property, I have selected Content option.
I have used the following connection:

Dim constring As String
constring = Application.StartupPath.ToString() + "\Customerdb.mdf"
Dim con = New SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=" + constring + ";Integrated Security=True;User Instance=True")

My problem is that I cannot access the database after installing the setup. the following error is thrown each time i try to access the database:

"An attempt to attach an auto-named database for file C:\Program File\App\Customerdb.mdf failed. A database with the same name exits, or specified file cannot be opened, or it is located on UNC share."

It seems like once installed, the application cannot have access to the database.

Could you please tell me what is wrong with the connection?
If possible, please i need very detailled procedure for this because i have never done this before and iam submitting soon.

Any help will be very very apreciated.
Thanks in advance
 
Back
Top