To avoid hard coding I am not using database path for Data Source. Instead of it, I am using |DataDirectory| and code in Form Loading like:
Code: Select all
AppDomain.CurrentDomain.SetData("DataDirectory", Settings.DataPath);
But when I use DataDirectory on both, I get an error. When I define another string instead of DataDirectory, for example, DataNewDirectory, in the model page like `<Connection Mode="ConnectionString" ConnectionString="Data Source=|DataNewDirectory|" Provider="Devart.Data.SQLite" />` I got "Illegal characters in path." error. How do I manage this?