I'm using an Access database. In order to achieve 1 of the data table "super Administrator", 0 for "News user", I read the data using the case ... when ... Statement:
Select (Case USERCALSS when 1 Then ' super admin ' else ' news user ') from admin
The results of the following error occurred:
Ierrorinfo.getdescription failed because of E_fail (0x80004005).
Note: An unhandled exception occurred during the execution of the current WEB request. Check the stack trace for more information about the error and where the error occurred in the code.
Exception Details: System.Data.OleDb.OleDbException:IErrorInfo.GetDescription failed because of E_fail (0x80004005).
Workaround:
The problem is solved by using the "IIF" function instead of the "case" statement. The SQL statement that implements the above effect is as follows:
Select Id,username,iif (Userclass=1, ' super admin ', ' news Add user ') as UserClass from admin