Share via


Running direct SQL code using Connection class

Sometimes you need to use direct SQL code in your methods. The easiest way is to use Connection class. However you might run into the error “Request for the permission of type 'SqlStatementExecutePermission' failed.” This is because you’re using the class in client-side code. Connection class has to be used only in server-side code, so you need to use it in class with RunOn property set to Server or in a server static method.

Martin F