IEnumerable<DataRow> q =
from
dr
in
dt.AsEnumerable()
where
dr.Field<
int
>(
"ID"
).ToString() == "1"
select
new
{
ID=dr["ID"].ToString(),
Name=dr["Name"].ToString(),
CreateDate=Convert.ToDateTime(dr["CreateDate"]).ToString("yyyy-MM-dd")
};
IEnumerable<DataRow> q = dt.AsEnumerable().Where<DataRow>(r => (r.Field<
int
>(
"ID"
).ToString() == "1"
));
时间: 2024-10-29 19:06:43