K
Kent Boogaart
Hi,
I am working on a web project and have split my data access layer into a
separate DLL. This separate DLL uses a .settings file to store the
connection string. A strongly-typed settings class is generated for me in
the background. However, this generated class is internal.
My problem is that I need to get to the connection string from the web
project in order to configure my logging subsystem (which logs to the DB).
Now, I can think of an obvious hack around this. I could just put something
like this in my DAL DLL:
public static class ConnectionDetails
{
public static string ConnectionString
{
get
{
//the Settings class is internal
return Settings.Default.MyConnectionString;
}
}
}
What I'm wondering is whether there is a better solution to this. Have I
overlooked something obvious here?
Thanks,
Kent
I am working on a web project and have split my data access layer into a
separate DLL. This separate DLL uses a .settings file to store the
connection string. A strongly-typed settings class is generated for me in
the background. However, this generated class is internal.
My problem is that I need to get to the connection string from the web
project in order to configure my logging subsystem (which logs to the DB).
Now, I can think of an obvious hack around this. I could just put something
like this in my DAL DLL:
public static class ConnectionDetails
{
public static string ConnectionString
{
get
{
//the Settings class is internal
return Settings.Default.MyConnectionString;
}
}
}
What I'm wondering is whether there is a better solution to this. Have I
overlooked something obvious here?
Thanks,
Kent