SomeType someValue = (SomeType)dt.Rows[SomeRowNumber][SomeColumnName or Index];
Note that you have to do an explicit cast (since the DataRowColumn is merely an object). Also, beware of DBNull.Value. The above statement will crash if that column contains DBNull.Value. There are ways around this (typically by checking first before assigning).// Suppose I've defined and filled a DataSet, ds, with a single DataTable Table1: >// I should be able to do something like >DataTable dt = ds.Tables["Table1"]; > >// Now that I have a reference to the table, how do I read values from its rows/columns? >// I'd expect to be able to do something like >SomeType someValue = dt.Rows[SomeRowNumber].Columns[SomeColumnName or Index].Value > >// but Intellisense is showing nothing of the sort.I could find no code samples on the Web. Literally all I could find in MSDN under "Viewing Data in a Table" was "You can access the contents of a DataTable using the Rows and Columns collections of the DataTable."