hi, I'm not very good at deployment and I'm facing a problem:
First Off, I'm 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 Embedded Resource
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?
Any help will be very very appreciated. Thanks in advance