Managing SQL Server using C#
I'm wondering whether and how I can do the following using .NET (more specifically, C#):
- Get a list of users from SQL Server
- Create a new Database in SQL Server
- Create a new user in SQL Server
- Connect to SQL Server with a user who has Windows Authentication enabled (instead of a login name and password inside SQL Server)
- Find the answer to similar questions - Where are things like these documented?
I've figured out how to create tables inside existing databases - you simply execute the correct SQL statement. But I can't figure out how to do these other things. Any help would be greatly appreciated.