Click here to Skip to main content
15,902,032 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I use two databases in my application. One for user/password and another for information. I want to link those two databases to my application in a way they can be read from the main directory where EXE file exists, so when I copy my application folder to another computer, the link between my app and databases is kept.
My current connection string is:
C#
sqlcon.ConnectionString = @"Data Source=C:\Users\Dell\Desktop\PMinfo\DataGridView\dbLogin.sdf";

How can I solve this issue?

What I have tried:

C#
sqlcon.ConnectionString = @"Data Source=C:\Users\Dell\Desktop\PMinfo\DataGridView\dbLogin.sdf";
Posted
Updated 21-Dec-20 8:17am
v3

1 solution

Don't.
See here: Where should I store my data?[^] for some better ideas.
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900