Apr 29, 2009 at 5:26 AM
Edited Apr 29, 2009 at 8:47 PM
I have a class Library Project in C# .NET . In That I have added referenece to the Ent Lib 3.1 Data ACcess APplication DLL's . I have added an app.config to the CLass Library project and Using the entlibraryconfig.exe I have created the connection string in
I now need to access the app.config from the class library for creating the Db:
db = DatabaseFactory.CreateDatabase("conn");
However since it is a class library project, it cannot read from the APP.config file.
I need a Class library because I need to reference this DLL from Biztalk application.
Please suggest what are my options for creating the connection string to get accessed from the class library project.
One option for you is to put the DAAB information in the application that will host the class library which is your biztalk application. Also, you can try to use the IConfigurationSource to read your app.config, you can learn more about IConfigurationSource
here: http://codebetter.com/blogs/david.hayden/archive/2006/01/08/136360.aspx .
Here is a code snippet for IConfigurationSource:
string configPath = GetConfigPath();
IConfigurationSource source =
DatabaseProviderFactory providerFactory =
Database db = providerFactory.Create("MyDatabase");
Global Technology and Solutions