C# LINQ Question -


i have following code

var query = lookup in dataset.tables["mbddx_lookup"].asenumerable()                                             lookup.field<string>("lookup_value") == "oncology"                      select new                     {                         lookupid = lookup.field<long>("id")                     }; 

this returns want. however, want check field within clause , 'select new' also.

how can this?

thanks.

edit: second piece of data wish extract within mbddx_lookup field.

if trying check same field 2 possible values, use or operator ||:

var query = lookup in dataset.tables["mbddx_lookup"].asenumerable()         lookup.field<string>("lookup_value") == "oncology" ||               lookup.field<string>("lookup_value") == "zoology"         select new {             lookupid = lookup.field<long>("id"),             lookup = lookup.field<string>("lookup_value")         }; 

Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -