Why DataTable.Select("IIF(...)") is refused !

  • Thread starter Thread starter sam
  • Start date Start date
S

sam

Why using an IIF in a DataTable.Select(IIF("column1=zz",
"column2","column3")); is in invalid context ?
What is the way for using an IIF in a Datatable.Select(...) ?

Thanks for help.

sam
 
Try placing the IIF inside a CStr() function, because IIF returns an Object,
you usually need to convert it. Good Luck!
 
Nathan Sokalski said:
Try placing the IIF inside a CStr() function, because IIF returns an
Object, you usually need to convert it. Good Luck!
I have drop the IIF in a Convert.ToString() but the compiler says:
DataTable.Select(Convert.ToString(IIF("name_real="+null,"name_to_use",
"")));
"The name 'identifier' does not exist in the current context "
Someone knows how using IIF in a DaTaTable.Select() ?

Sam
 
DataTable uses a regular expression to parse your filter. It is likely that
they don't support some SQL functions.
Use a query to populate the data table with filtered results.
 
Back
Top