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
IDictionary dict = new Dictionary(); DataTable mydata = new DataTable("hey"); foreach (DataRow item in mydata.Rows) { dict.Add(item["id"], item["name"]); }