Friday, 16 August 2013

LINQ Select DataRow from DataTable

LINQ Select DataRow from DataTable

I have a DataTable i am trying to do a simple select row that contains a
value.
My code
var LoginDetails = from myRow in DTOperators.AsEnumerable()
where myRow.Field<string>(0) == UserName
select myRow;
I am trying to check if the string UserName exists at position 0 the rows
in the datatable
When i run this query i get a blank datarow back.
I have tried to use [] around the position that i want to select.
anyone able to see what i am doing wrong.

No comments:

Post a Comment