I have a code
DataView res = (from a in dtvw.AsEnumerable()
where a.Field<string>(creteriaattributeID) == rightval
select a).AsDataView();
here , i wanna get the operator ("== ") at runtime is it possible ?
I tried using
where a.Field<string>(creteriaattributeID) + operator + rightval
operator --> string variable so it wont b possible ... Can you suggest any other methods...
You can think of the == operator as function which takes two strings and return bool.
So for example Func<string, string, bool>.
Can you just use a variable of this type:
Func<string, string, bool> equal = (a,b) => { return a == b; };
Func<string, string, bool> notequal = (a,b) => { return a != b; };
DataView res = (from a in dtvw.AsEnumerable()
where equal(a.Field<string>(creteriaattributeID), rightval)
select a).AsDataView();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With