MSSQL mssqlsqlconnection string 27/02/2016

Specify instance name in connectiong string (MSSQL)

To connect to default SQL instance, provide just server DNS name (or IP address):

string connectionString = @"Data Source=SERVER_NAME; Initial Catalog=DATABASE_NAME; User ID=; Password=";

To connect to specific SQL instance, provide instance name after server DNS name:

string connectionString = @"Data Source=SERVER_NAME\INSTANCE_NAME; Initial Catalog=DATABASE_NAME; User ID=; Password=;