I made a data connection with a custom query, that looks like this:
SELECT DISTINCT
CASE isActive
when 1 then 'yes'
when 0 then 'no'
else 'unknown'
end AS isActive
FROM [dbo].[Members]
I bound this data connection to a list box and it works fine.
I call this data connection from manage code:
thisXDocument.DataObjects[secondary].Query();
and it still works fine.
But when I change the query with manged code, I get
noreturn set:
ADOAdapter oSecondary;
oSecondary = ADOAdapter)thisXDocument.DataObjects[secondary].QueryAdapter;
oSecondary.Command = "SELECT DISTINCT " +
" CASE " + column +
" WHEN 0 THEN '" + c0 + "'" +
" WHEN 1 THEN '" + c1 + "'" +
" ELSE 'unknown'" +
" END AS " + column +
" FROM " + table + " ORDER BY " + column;
thisXDocument.DataObjects[secondary].Query();
Can anybody help me?
Thanks in advance!