DataTable dt = ds.Tables[0]; >List< KeyValuePair<string, string>> MyList = dt.Columns.OfType<DataColumn>().Select(dc => new KeyValuePair<string, string>(dc.ColumnName, dt.Rows[0][dc].ToString())).ToList(); >>or
DataTable dt = ds.Tables[0]; >Dictionary<string, string> MyDictionary = dt.Columns.OfType<DataColumn>().ToDictionary(dc => dc.ColumnName, dc => dt.Rows[0][dc].ToString()); >Sorry Rob - I meant Dictionary - bit of thread drift creeping in - I've been working with lists and dictionaries in the same thread - my bad - your second suggestion looks perfect - where did you learn all this stuff ?