ADO Net C# Tutorial

using System;
using System.Data.SqlClient;
    class Program
    {
        static void Main(string[] args)
        {
            string connectString =
                "Network Library=dbmssocn;Network Address=127.0.0.1;" +
                "Integrated security=SSPI;Initial Catalog=AdventureWorks";
            using (SqlConnection connection = new SqlConnection(connectString))
            {
                connection.Open(  );
                Console.WriteLine(connection.State);
            }
        }
    }