日期:2014-05-20 浏览次数:20989 次
DataTable dt = new DataTable();
DataColumn dc = new DataColumn("content", typeof(string));
dt.Columns.Add(dc);
DataRow dr1 = dt.NewRow();
dr1["content"] = "ww";
dt.Rows.Add(dr1);
DataRow dr2 = dt.NewRow();
dr2["content"] = "ss";
dt.Rows.Add(dr2);
DataRow dr3 = dt.NewRow();
dr3["content"] = "ff";
dt.Rows.Add(dr3);
int i=1;
var query = from p in dt.AsEnumerable()
select new
{
uid = i++,
content = p.ItemArray[0]
};