Request for the permission of type ‘System.Data…’ failed
While testing one of the old samples I found that it is giving me an exceptions of permissions. The exception raised was Request for the permission of type 'System.Data.OleDb.OleDbPermission, System.Data, Version 22.214.171.124, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. Upon checking I found that I have opened the project from a Network Drive location which as causing the permissions problem.
To resolve this you can simply take the copy of code to local drive and reopen the project.