Productivity Tools

Tools written by an IT business manager, a passionate developer.

ConnectionString – to be updated

ConnectionString generates connection string in c# code.

Connection string can be prepared in 3 format:

Folowing code

 var serverName=ConnectionStringHelper.ConnectionString.GetSqlDataSourceConnectionString("serverName");
 Console.WriteLine(serverName);
 Console.WriteLine();
 var serverNameWithDatabase= ConnectionStringHelper.ConnectionString.GetSqlServerConnectionString("serverName","databaseName");
 Console.WriteLine(serverNameWithDatabase);
 Console.WriteLine();
 var entityFramework = ConnectionStringHelper.ConnectionString.GetSqlEntityFrameworkConnectionString("serverName", "databaseName", "metadata");
 Console.WriteLine(entityFramework);
 Console.WriteLine();

Will result in following connection strings:

Module dependents on the ConnectionStringLight