Answered by:
How do i make an application that comes with a database?

Question
-
I just made a password generator/manager that works great on my computer. what seems to happen when i try to copy the published file to my wife's computer it get the error 52 and fails to connect to the databaseMonday, April 21, 2014 1:58 AM
Answers
-
so the other computer is trying to connect to the original computer
No, you are using LocalDB and that don't support remote connections from other machines. You would have to use SQL Express instead and enable remote connection to have a centralize SQL Server; LocalDB is only for single machine / local usage of applications.Olaf Helper
[ Blog] [ Xing] [ MVP]- Marked as answer by Sofiya Li Tuesday, April 29, 2014 3:46 AM
Monday, April 21, 2014 2:04 PMAnswerer -
- Proposed as answer by Naomi NEditor Monday, April 21, 2014 6:28 PM
- Marked as answer by Sofiya Li Tuesday, April 29, 2014 3:46 AM
Monday, April 21, 2014 5:06 PMAnswerer -
In your connection string you have AttachDbFileName property. Copy the DB to the other computer and use correct path and file name. I suggest to use a simpler path than the one you're currently using.
For every expert, there is an equal and opposite expert. - Becker's Law
My blog
My TechNet articlesMonday, April 21, 2014 6:30 PMAnswerer
All replies
-
Monday, April 21, 2014 6:28 AMAnswerer
-
well i am trying to make the database unique per computer so that it has it's own,
the connection string for the one on my computer is Data Source=(LocalDB)\v11.0;AttachDbFilename="C:\Users\derek\Documents\Visual Studio 2013\Projects\WindowsApplication3\WindowsApplication3\Database1.mdf";Integrated Security=True
so the other computer is trying to connect to the original computer
Monday, April 21, 2014 12:55 PM -
so the other computer is trying to connect to the original computer
No, you are using LocalDB and that don't support remote connections from other machines. You would have to use SQL Express instead and enable remote connection to have a centralize SQL Server; LocalDB is only for single machine / local usage of applications.Olaf Helper
[ Blog] [ Xing] [ MVP]- Marked as answer by Sofiya Li Tuesday, April 29, 2014 3:46 AM
Monday, April 21, 2014 2:04 PMAnswerer -
ya that is what i want, i want the application to have it's own database that is unique per computer, i am sorry i am very green at the gills with codeingMonday, April 21, 2014 4:58 PM
-
- Proposed as answer by Naomi NEditor Monday, April 21, 2014 6:28 PM
- Marked as answer by Sofiya Li Tuesday, April 29, 2014 3:46 AM
Monday, April 21, 2014 5:06 PMAnswerer -
I am not sure exactly how to do that
Monday, April 21, 2014 6:26 PM -
In your connection string you have AttachDbFileName property. Copy the DB to the other computer and use correct path and file name. I suggest to use a simpler path than the one you're currently using.
For every expert, there is an equal and opposite expert. - Becker's Law
My blog
My TechNet articlesMonday, April 21, 2014 6:30 PMAnswerer -
Use please :
Data Source=.\v11.0;AttachDbFilename="Path\Database1.mdf";Integrated Security=True
And replace (Path) with your real path of the file in every machine.
Not the Data Source, i use :
.\v11.0
To specify the local machine.
Monday, April 21, 2014 6:35 PM