I have a datatable which has 3 columns "Name","Type","ID" i want to use only one column in it for comparison. Which is "Type". I wanted to take that column put it in a DataColumn separated from the datatable, compare the values of the cells in it with a string and then pass a string if it matches. I am not sure if this method is right or wrong, i even dont know how to get the string value of the cells (rows) in this Datacolumn to be compared
Here is my code for it :
DataTable Griddetails;
Griddetails = RxMUaClient.BrowseGrid("2", "127.0.0.1:48030", nodepassed);
var myColumn = Griddetails.Columns.Cast<DataColumn>()
.SingleOrDefault(col => col.ColumnName == "Type");
return Json(myColumn);
if (myColumn != null)
{
for (int i = 0; i <= myColumn.; i++ )
{
}
}
I am trying to get the datarow count in the dataColumn either by a for loop or foreach, the foreach is not working for some error and the i don't know how to get the value of the datacolumn for the for loop.
Any help ?