I have a simple SQL query (using SqlCommand, SqlTransaction) in .NET 2.0 that returns a table of integer-string pairs (ID, Name). I want to get this data into a dictionary like
// Define your Dictionary
IDictionary dictionary = new Dictionary();
// Read your dataTable
foreach(DataRow row in dataTable.Rows) {
// Add Id and Name respectively
dictionary.Add(int.parse(row[0].ToString()),row[1].ToString())
}