In visual Studio project is run under local user, who usually have full permission to resources such as folders and databases. In IIS, the Application is run under Local System or Network User etc which do not have full permission to all folders and the databases. In fact they don’t have access to databases at all.
To trouble shoot enable error reporting, if you are using exceptions, throw exception back in the catch block so you can see what is going on.
Create a new service user or just a regular user and make this user admin. In application pool in IIS, select the AppPool that is giving you the problem, click on advance setting and change identity to this new user. That should fix the problem.