Connection Strings and Configuration Files

Sometimes you might see a variation of the service provider design that provides its connection string as a property or requires the connection string in its constructor. This design might seem like a good idea because it allows flexibility for the data access class to be used with different data sources or login information. However, this approach also creates its share of problems:

  • It introduces one more area in which the component will be susceptible to client mistakes.

  • It introduces one more area where security can be compromised because each client will need to know the database user ID and password.

  • It can threaten connection pooling because minor changes in the connection string result in the creation ...

Get Microsoft® .NET Distributed Applications: Integrating XML Web Services and .NET Remoting now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.