I have a DataTable filled with database table (two columns) id
and class
. I want to compare the column class
value with string and find the corresponding id
value. The classID
should be int
type.
My code:
int classID = from DataRow row in dtClassesDb.Rows where
row.ItemArray[1].ToString().Equals(table.TableName)
select row.ItemArray[0];