ADO Net C# Tutorial

using System;
using System.Data;
using System.Data.SqlClient;
    class Program
    {
        static void Main(string[] args)
        {
            string sqlConnectString = "Data Source=(local);Integrated security=SSPI;Initial Catalog=AdventureWorks;";
            string sqlSelect = "SELECT ContactID, FirstName, LastName FROM Person.Contact";
            SqlDataAdapter da = new SqlDataAdapter(sqlSelect, sqlConnectString);
            DataTable dt = new DataTable( );
            da.Fill(dt);
            Console.WriteLine("FirstName = {0}", dt.Rows[2][1]);
            Console.WriteLine("FirstName = {0}", dt.Rows[2]["FirstName"]);
            Console.WriteLine("FirstName = {0}",dt.Rows[2]["FirstName", DataRowVersion.Default]);
            Console.WriteLine("FirstName = {0}", dt.Rows[2][dt.Columns[1]]);
            Console.WriteLine("FirstName = {0}",dt.Rows[2][dt.Columns["FirstName"]]);
            Console.WriteLine("FirstName = {0}",dt.Rows[2].Field(1));
            Console.WriteLine("FirstName = {0}",dt.Rows[2].Field("FirstName"));
            Console.WriteLine("FirstName = {0}",dt.Rows[2].Field("FirstName", DataRowVersion.Default));
            Console.WriteLine("FirstName = {0}",dt.Rows[2].Field(dt.Columns[1]));
            Console.WriteLine("FirstName = {0}",dt.Rows[2].Field(dt.Columns["FirstName"]));
        }
    }