Skip to content

Asp.net class to manage connection strings in the web.config file

Notifications You must be signed in to change notification settings

ZiadJ/ConnectionStringManager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

ConnectionStringManager

Asp.net class to manage connection strings in web.config file. It will only add a connection string the web.config file if it's not already there. It can also encrypt the data so it can only be read by the machine on which it was created.

Usage:

var settings = new Dictionary<string, ConnectionSetting>();

// Create a plain SQL connection string.
settings.Add([ConnectionName], new SqlConnectionSetting(null, [DbName], [Username], [Password], true, false, true, null));

// Create an EF based connection string.
settings.Add([ConnectionName], new EntityConnectionSetting([ModelName], new SqlConnectionSetting(null, [DbName], [Username], [Password], true, false, true, "EntityFramework")));

// Write connection strings to the web.config file in encrypted form.
WebConfigConnectionStringManager.SetConnectionStrings(col, true);

About

Asp.net class to manage connection strings in the web.config file

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages