For partial-trust scenarios, you can require CAS privileges for particular methods in your code by specifying an attribute
SqldataAttribute
SqlClientPermissionAttribute
SecqurityAttribute
None of these