#眉標=.NET Language-Integrated Query #副標=初探 Microsoft 下一代的資料存取技術 #大標= LINQ Overview #作者=文/李毅騁 ==<程式1>=========== SqlConnection c = new SqlConnection( ConnectionString ); c.Open(); SqlCommand cmd = new SqlCommand( @"SELECT c.Name, c.Phone, c.ApplyDate FROM Customers as c WHERE c.City = @p0" ); cmd.Parameters.AddWithValue("@po", "Taipei"); SqlDataReader dr = c.ExecuteReader (cmd); while (dr.Read()) { CustObj.Name = dr.GetString(0); CustObj.Phone = dr.GetString(1); CustObj.ApplyDate = dr.GetDateTime(2); } dr.Close(); ==<程式1 end>==============