void method3() { // <Snippet3> // using System.Data.Common; Northwnd db = new Northwnd(@"c:\northwnd.mdf"); var q = from cust in db.Customers where cust.City == "London" select cust; Console.WriteLine("Customers from London:"); foreach (var z in q) { Console.WriteLine("\t {0}", z.ContactName); } DbCommand dc = db.GetCommand(q); Console.WriteLine("\nCommand Text: \n{0}", dc.CommandText); Console.WriteLine("\nCommand Type: {0}", dc.CommandType); Console.WriteLine("\nConnection: {0}", dc.Connection); Console.ReadLine(); // </Snippet3> }