Want create site? Find Free WordPress Themes and plugins.
I have a DataTable. I want to select the rows based on the Index/ Row Number of the rows in DataTable.
An error has occurred. Please try again later.
I can use LINQ to DataSet/DataTable for get datarow on condition.
var rows = dt.AsEnumerable().Where(r=> r.Field<int>("ID") == 5);
//Since each row has a unique ID, you should use Single/SingleOrDefault which would throw exception if you get multiple records back.
DataRow dr = dt.AsEnumerable().SingleOrDefault(r=> r.Field<int>("ID") == 5);
//Substitute int for the type of your ID field
DataRow dataRow = dataTable.AsEnumerable().FirstOrDefault(r => Convert.ToInt32(r["ID"]) == 5);
if (dataRow != null)
Did you find apk for android? You can find new Free Android Games and apps.