I am trying to convert from datatable to array[] using linq and then join that array in one string using string.join.
Here is the code:
string.Join("','", dt
.Select("IsCount = '1'")
.OfType<DataRow>()
.Select(dr => dr.Field<string>(0))
.ToArray())
But it gives error like:
Expression cannot contain lambda expressions
.ToArray()is redundant in the context, sincestring.JoinacceptsIEnumerable<T>cannot perform '=' operation on System.Boolean and System.String.