Hi! I'm working in a c# desktop application, using visual studio 2010.
I want to read each record and load a "street name dictionary" for each US state.
For example, I read first record (id=1), so I load AlabamaDictionary.txt because this record it is from Alabama State, after load it, start another process like address standardizations, etc. When this process it is finished, I read next record (id=2) and I've to check if "State" is the same, if is the same state than before, I don't need to load again AlabamaDictionary.txt because it is load it yet, start another process like address standardizations. When this process it is finished, I read next record (id=3) which is from "Arizona". Here state change so I need to load Arizona.txt and start again another address standardizations process, etc...
my problem is to change dictionary, to check when it is change.
Records
"id" | "address" | "state"
1 |100 Elm St | Alabama
2 |300 Trawick St | Alabama
3 |50023 N 51st Ave | Arizona
I Have next loop
Code:
DataTable records;
for (int i = 0; i < records.Rows.Count; i++)
{
string address = records.Rows[i][1].ToString();
string state = records.Rows[i][2].ToString();
streetDictionary = state + ".txt";
if(File.Exists(streetDictionary))
{
LoadStreetDictionary(streetDictionary);
StreetNameStandardization(address)
}
}
Please, How can i do this loop?
Thank you very much!