dataTable转换特定的类

var query = dt
.AsEnumerable()
.Where(x => x.Field<string>("phoneNumber") != string.Empty)
.Select(x => new Contact
{
FirstName = x.Field<string>("First Name"),
LastName = x.Field<string>("Last Name"),
PhoneNumber = x.Field<string>("Phone Number"),
});

上一篇:DataTable运用


下一篇:Json与DataSet转化