.NET DLL's

  • Thread starter Thread starter Dmitry Lyalin
  • Start date Start date
D

Dmitry Lyalin

So tehre is no way to have a DLL read any kind of config file like
app.config?

My front end is an ASP.NET application and i was hoping to have all my
database logic handled from within the component. Thats why i built a
ConnectionString class with static string functions to return my
connection string.

Anyone have any other ideas? I would hate to have to build a custom
solution for something so simplistic.

Maybe im just thinking about this in the wrong way from a design
standpoint...
 
Dmitry,

Add the following to the <configuration> section of your web.config file:

<appSettings>
<add key="ConnectionString" value="Data Source= ........." />
</appSettings>

Then in your dll, create a connection:

SqlConnection connection = new
SqlConnection(System.Configuration.ConfigurationSettings.AppSettings["ConnectionString"]);


Or if you are using the designer for the Connection, check out the 'Dynamic
Properties' section of the properties grid.
 
Back
Top