var p = DataTable.AsEnumerable().Where(t => t.Field<int>("ChannelID") == int.Parse(code)).Select(d => d); if (p != null && p.Count() > 0) { return p.Select(c => c.Field<string>("name")).First(); } else { return ""; }
var p = DataTable.AsEnumerable().Where(t => t.Field<int>("ChannelID") == int.Parse(code)).Select(d => d); if (p != null && p.Count() > 0) { return p.Select(c => c.Field<string>("name")).First(); } else { return ""; }
转载于:https://www.cnblogs.com/Yellowshorts/p/3564642.html