How to Add Users to SQL Server database

How do you add users to a SQL Server Database using C#?  I want to add 5 users to a database with a domain\user format.  Thanks!
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

execute a CREATE LOGIN/CREATE USER statement...

delete them using DROP USER
VBBRettAuthor Commented:
How do you give the user roles like DbOwner?
You can add roles using sp_addrolemember. See
Exploring SharePoint 2016

Explore SharePoint 2016, the web-based, collaborative platform that integrates with Microsoft Office to provide intranets, secure document management, and collaboration so you can develop your online and offline capabilities.

VBBRettAuthor Commented:
And how do you specify the domain where the user is coming from given that when I add the user domain\\user I get the following error:  

I would like to add the following user:

Mycompanydomain\myuser as opposed to just myuser.
VBBRettAuthor Commented:
This is not working, especially that I am passing the query through my C# code to get this work.  Please help me find a solution so I can put this to rest.  I need the following written in C#

SqlCommand cmd = new SqlCommand("Create LOGIN " + usertobeadded + " USE " + databasename + " " +"CREATE USER " + usertobeadded + " FOR LOGIN " + usertobeadded " GO", conn);

I keep on getting with the '\' sign or the ';' sign.  What do I do?
My C# is a little rusty, but I'll try. See for more information. I wanted to get the information to you quickly. If below doesn't work, I'll fire up my C# environment and make sure I get the syntax right.

//Create New User
SqlCommand cmd = new SqlCommand("CREATE USER " + NameForSQL + " FOR LOGIN [" + Domain + "\" + User + "]", conn);

//Add Role
SqlCommand2 cmd = new SqlCommand("EXEC sp_addrolemember '" + Role + "', '" + NameForSQL + "'", conn);

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
I'm not a C# developer - I code mainly in Java - but I'm guessing it might be an issue with escaping the backslash character.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.