Reputation: 133
I want to add new column 'temp' into datatable with following below
datatable.Columns.Add(
'temp', typeof(string),
"Convert(IFF(" + column +
" like '%#' == True ,'isTrue','isFalse'), 'System.String')");
but I get an error: "The expression contains undefined function call IFF()."
Upvotes: 0
Views: 919
Reputation: 53593
Simple typo: IFF
should be IIF
.
I also think there's something wrong with your conditional expression in your IIF statement. Try this instead:
datatable.Columns.Add("temp", typeof(string),
"Convert(IIF(" + column + " like '%#','isTrue','isFalse'), 'System.String')");
Upvotes: 8