var course = from b in DbModle.courses
where b.name == "test"
select b;
DataTable dt = new DataTable();
DataRow dr;
dt.Columns.Add(new DataColumn("name", typeof(string)));
dt.Columns.Add(new DataColumn("id", typeof(int)));
foreach (var course1 in course_university)
{
dr = dt.NewRow();
dr[0] = course1.name;
dr[1] = course1.id;
dt.Rows.Add(dr);
}
如何按ID排序DataTable
?按字段排序數據表
怎麼可以這樣寫一個例子 – user1263390 2012-03-22 21:29:53
退房在LINQ查詢的OrderBy行。 – 2012-03-22 21:32:17