Using SqlConnectionStringBuilder class in C#

Microsoft introduced a new class in ADO.NET 2.0 version which can be used to build database connection strings specific to the provider you are using in ADO.NET. Different database providers expose different properties for the connection strings. For example, SQL Server connection string properties are different than MySql or OleDb connection strings. Although, it is possible to concatenate strings to build a complete connection string but by using .NET connection string builder class you don’t need to memorize the properties appropriate to specific provider.

Using SqlConnectionStringBuilder class in C#

Read Full Tutorial


Storing Database Connection Strings in App.Config

Storing database connection strings in source code can lead you to some security issues and can also cause you maintenance problems. It is always recommended that you keep your connection strings in a separate configuration file so that you can change database connection related information such as password or database name without even modifying or recompiling your source code.

Read Full Tutorial

Connection String Encryption in Web.config using VB.NET

Almost all ASP.NET web sites connect database and one of the best practices in ASP.NET is to store your database connection string outside your source code typically in web configuration file (web.config). This gives you benefit of changing your database related information such as the server name, user id or password without any modification or compilation of your source code. To provide additional security of important connection string information you should always encrypt your connection string in web.config file.

Read Full Tutorial