Dynamic OleDbConnection1.ConnectionString

F

Frank

I am having a problem in that I have written an application that uses a
database. It runs fine in debug mode because the application looks in my
'D:\Documents and Settings\Frank Hayward\My Documents\Visual Studio
Projects\StatCon5' folder for the database. However, once the application
has been installed on the client machine, the application folder is more
likely to be somewhere on c:\???.

I have made the OleDbConnection1.ConnectionString dynamic and put it in the
application.exe.config folder for easy editing.

How can I fix this??

<?xml version="1.0" encoding="Windows-1252"?>
<configuration>

<appSettings>



<add key="OleDbConnection1.ConnectionString"
value="Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Data
Source=D:\Documents and Settings\Frank Hayward\My Documents\Visual Studio
Projects\StatCon5\Statcon5.mdb;........." />

</appSettings>



</configuration>
 
R

Robbe Morris [C# MVP]

Look at the results of calling this and make your adjustements accordingly.

AppPath = Path.GetFullPath(".");
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,983
Messages
2,570,187
Members
46,747
Latest member
jojoBizaroo

Latest Threads

Top