ADO Net C# Tutorial

using System;
using System.Data;
using System.Data.SqlClient;
    class FilterSort{
        static void Main(string[] args)
        {
            string connString = @"server = .\sqlexpress;integrated security = true;database = northwind";
            string sql1 = @"select * from customers";
            string sql2 = @"select * from products where unitprice < 10";
            string sql = sql1 + sql2;
            SqlConnection conn = new SqlConnection(connString);
            try
            {
                SqlDataAdapter da = new SqlDataAdapter();
                da.SelectCommand = new SqlCommand(sql, conn);
                DataSet ds = new DataSet();
                da.Fill(ds, "customers");
                DataTableCollection dtc = ds.Tables;
                string fl = "country = 'Germany'";
                string srt = "companyname asc";
                foreach (DataRow row in dtc["customers"].Select(fl, srt))
                {
                    Console.WriteLine(row["CompanyName"]);
                    Console.WriteLine(row["ContactName"]);
                }
                foreach (DataRow row in dtc[1].Rows)
                {
                    Console.WriteLine(row["productname"]);
                    Console.WriteLine(row["unitprice"]);
                }
            }
            catch (Exception e)
            {
                Console.WriteLine("Error: " + e);
            }
            finally
            {
                conn.Close();
            } Console.ReadLine();
        }
    }