image0015

Create a Dictionary<int,int> object dcRecordsTable

Call the UpdateLookUpTable method as follows:

private void UpdateLookUpTable(int intFieldCount)

{

if (!dcRecordsTable.ContainsKey(intFieldCount))

{

dcRecordsTable.Add(intFieldCount, 0);

}

dcRecordsTable[intFieldCount]++;

}

This will check if the Key exists in the LookUp table. If it exists , it will update the value corresponding to it

Otherwise it will create a new key and enter the value count in the value field.

Advertisements