Count Occurence of Two Characters in a DataGridView Column

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Having difficulty finding an answer to my question...



In my DataGridView (Device_AttributesDataGridView) I have three columns. The third column has 126 rows (populated by an access database), each of these 126 cells in this third column has a string of characters which is 10 characters long. 





What I want to do is count the number of occurences of "01", "02", "03" up to "09" in the 7th and 8th character position of my strings in the 126 cells. So out of the 126 cells, if there are 19 occurences of "02"
in the 7th and 8th position ("xxxxxx02xx") a read-only text box should return the number 19. 
<br/>

I have nine textboxes to show the number of &quot;01&quot;, &quot;02&quot;, &quot;03&quot; up to &quot;09&quot; occurences out of the third column in my DGV. 
Any ideas?<br/>

<br/>
<br/>

View the full article
 
Back
Top