using System;
using System.Collections.Generic;
using System.Text;
using System.Data.SqlClient;
namespace ADOConnection
{
    class Program
    {
        static void Main(string[] args)
        {
            SqlConnection conn = new SqlConnection(
                "server='(local)';Trusted_Connection=true;multipleactiveresultsets=false");
            SqlCommand cmd =
                new SqlCommand("select * from pubs..authors", conn);
            conn.Open();
            SqlDataReader rdr = cmd.ExecuteReader();
            while (rdr.Read())
            {
                Console.WriteLine(rdr[0]);
            }
        }
    }
}
