Linq to sql 自定義型別

世紀緣發表於2016-03-22
            string sql = "select a.hotelid,b.rating from Hotel a ,HotelReviews b where a.hotelid = b.hotelid";

            LinqDataContext cxt = new LinqDataContext();

            IEnumerable<Temp> temp = cxt.ExecuteQuery<Temp>(sql);

            this.dataGridView2.DataSource = temp.ToList();

相關文章