Quantcast
Viewing all articles
Browse latest Browse all 3

Connection string problem

I am having problems with embading sql server express, which comes with VS 2008. I did an application in C#, which is using Express database. And when I publish (do a setup.exe file - an installer actually) the application, there is the dabasase embaded into it, but it is still looking for the full path where is was before (when I was creating the application).
I have an App.config file where is the connection string to the database:

<?xml version="1.0" encoding="utf-8" ?><configuration><configSections></configSections><connectionStrings><add name="Povezava" 
         connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=D:\Informatika\PRO2\test aplikacije\AvtoKrka\AvtoKrka.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True"
      providerName="System.Data.SqlClient" /></connectionStrings></configuration>


There you can see I have a database located in disk D:\Informatika\PRO2\test aplikacije\AvtoKrka\AvtoKrka.mdf
When I do an installer it still keep on searching for this string. 

I would like to know what do do, that there wont be this string, that the app. will work on every computer I install it.
Please for some help.
Mitja

Viewing all articles
Browse latest Browse all 3

Trending Articles