using System;
using System.Data;
using System.Data.Common;
using System.Data.SqlClient;
using System.Collections.Generic;
using System.Text;

namespace ConnectionTest
{
   class Program
   {
      static void Main(string[] args)
      {
         SqlConnectionStringBuilder connBuilder =
           new SqlConnectionStringBuilder();
         connBuilder.InitialCatalog = "TestDB";
         connBuilder.DataSource = @".\SQLExpress";
         connBuilder.IntegratedSecurity = true;
         SqlConnection conn = new SqlConnection(connBuilder.ConnectionString);

         conn.Open();
         Console.WriteLine("Połączono z SQL Server v" + conn.ServerVersion);
         conn.Close();
         Console.ReadLine();
      }
   }
}
