I have two columns with Col1
and col2
in data table like below:
note:
col1 contains only us or uk, no other values
Now my requirement is to separate the values based on us and uk.
Like below get all the values corresponding to us and uk seperately.
Earlier I have done this with linq code. At that time my requirement is a simple one,
just get all the records in col2
:
string[] data = dt.AsEnumerable()
.Select(s => s.Field<string>("col2"))
.ToArray<string>();
now in the new requirement I need them separately based on us and uk.
Enumerable.Where