How to get the total of specific column contains with specific string drom datatable.
I followed as like below but not getting :
int count = _dt.AsEnumerable().Where(c => c.Field<string>
("EffectiveShow").Equals("0")).count;
There "EffectiveShow" is my column name. In that column I need the count of string "0".
尝试这个;
int count = _dt.AsEnumerable().Where(c => c["EffectiveShow"].ToString()=="0").ToList().Count;
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.