How do I limit the permissions of a C# program to read only on an SQLServer Database?

Posted by gav on Stack Overflow See other posts from Stack Overflow or by gav
Published on 2010-04-20T09:49:32Z Indexed on 2010/04/20 9:53 UTC
Read the original article Hit count: 333

Filed under:
|

Hi Guys,

I have written some C# which connects to a live production database. I want to give my application read only access to the DB but am unsure how to achieve this.

Is there any trivial way to get this done by amending the connection string?

My understanding is that the application will logon with the credentials of the person running the application and hence may or may not have write access to the db based on that fact. Can I statically limit the permissions of the application so that if someone changes the program to do something devastating at a later date any manipulation will fail?

Apologies for how trivial the question may be but it's my first venture into the world of MS programming.

Thanks,

Gav

© Stack Overflow or respective owner

Related posts about c#

Related posts about SQLServer