using System;
using System.Data.SqlClient;
class Program
{
static void Main(string[] args)
{
string sqlConnectString = @"Data Source=(local)\SQLExpress;Integrated security=SSPI;Initial Catalog=master;";
using (SqlConnection connection = new SqlConnection(sqlConnectString))
{
connection.Open( );
Console.WriteLine(connection.State);
Console.WriteLine(connection.DataSource);
Console.WriteLine(connection.ServerVersion);
}
}
}