I have two columns in a datatable:
ID, Calls.
How do I find what the value of Calls is where ID = 5
?
5 could be anynu
try this code
DataRow foundRow = FinalDt.Rows.Find(Value);
but set at lease one primary key
DataRow dataRow = dataTable.AsEnumerable().FirstOrDefault(r => Convert.ToInt32(r["ID"]) == 5);
if (dataRow != null)
{
// code
}
If it is a typed DataSet:
MyDatasetType.MyDataTableRow dataRow = dataSet.MyDataTable.FirstOrDefault(r => r.ID == 5);
if (dataRow != null)
{
// code
}