Click here to Skip to main content
16,004,452 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
I would like to know if it is possible to create a SQL user using C#. If this is possible how would i go about doing this.
Posted
Comments
Richard C Bishop 5-Mar-13 10:25am    
You can write SQL in C# as a string value and use parameterized queries to insert the values. This is basic stuff, just search google for examples.

1 solution

Yes - connect to the server, and use SQL CREATE LOGIN[^] to create them, then CREATE USER[^] to give the permissions.
 
Share this answer
 
Comments
OriginalGriff 23-Oct-20 2:15am    
Follow the links?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900