using System.Data.SqlClient;
public static void Main()
var sqlconnectstring = new SqlConnectionStringBuilder();
sqlconnectstring.IntegratedSecurity = true;
sqlconnectstring.InitialCatalog = "students";
sqlconnectstring.DataSource = "localhost";
string connectionString = sqlconnectstring.ToString();
using (SqlConnection cnn = new SqlConnection(connectionString)) {
Console.WriteLine("Connection Open ! ");
Console.WriteLine("Can not open connection ! ");