I´ve got the following connectionstring:
string connectionstring = "Data Source=.\\SQLEXPRESS;AttachDbFilename=C:\\Users\\Harald\\Desktop\\Farmer´s Calc\\Programmierung\\WPF\\Finanz_WPF\\Finanz_WPF\\Datenbank\\FarmersCalc.mdf;Integrated Security=True;User Instance=True";
I need to make it dynamic, not the whole path should be included…
I tried it with |DataDirectory| but it seems to work just in ASP.NET.
How can I manage this?
You can take a look at the SqlConnectionStringBuilder class (http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnectionstringbuilder.aspx).