Is it possible to dynamically set a static string during compile?
- by LonnieBest
I'm trying to dynamically create a connection string during compile time:
public static string ConnectionString
{
get
{
string connectionString = @"Data Source=" + myLibrary.common.GetExeDir() + @"\Database\db.sdf;";
return connectionString;
}
}
I keep running into type initialisation errors. I was trying to avoid having to set the connection string for all applications that user my code library. The location of the database is different for each project that uses the library. I have code that can determine the correction string, but was wanting run it during compile time. Is this even possible?