Failed to get the correct result set.


PowerServer 2021 and later


There is a CommandTimeout option in the database connection configuration which is 30 by default. CommandTimeout specifies the waiting time before terminating the attempt to execute a command and throwing an error. The default value is 30 seconds. You should set values based on the actual needs, for example, if the SQL query would take more than 30 seconds to parse, you should increase the timeout value accordingly, otherwise, the data operations will fail when the timeout value is reached. Setting appropriate timeout periods for commands can reduce the occurrence of database deadlock and block.


You can set the command timeout value for each database connection in the project painter > Database page > Basic tab > More button > Advanced dialog > Command Timeout.

You can also change the command timeout value for each database connection cache in the PowerServer C# solution > ServerAPIs project > AppConfig > Applications.json > "Connections":

For more about timeout settings, please refer to: