Hello how can i count a word in dataGridView like an example
i have a cars model
BMW, Audi, Mitsubishi, Mercedes .etc
i want a code to count how many bmw i have ,how many Mercedes i have. etc
in a lable.text
Hello how can i count a word in dataGridView like an example
i have a cars model
BMW, Audi, Mitsubishi, Mercedes .etc
i want a code to count how many bmw i have ,how many Mercedes i have. etc
in a lable.text
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Rajanikant HawaldarRank #110 · 20.2K reputationPosted Aug 5, 2022, 9:09 AM EDT
Vishal YelveRank #178 · 13.6K reputationPosted Aug 5, 2022, 3:30 PM EDT
Please check the below link it might help.
https://www.aspsnippets.com/questions/209277/Count-number-of-record-for-specific-string-in-DataGridview-row-using-C-and-VBNet-in-Windows-Forms-Application/
Also this might help.
int x = 4; lblRows2.Text = (from Rows in DataGridView1.Rows.Cast() where !Rows.IsNewRow && Rows.Cells(x).Value.ToString == "Mercedes" select Rows).Count;