Hello!
I have been looking around for this for awhile, and haven't come up with any way to just simply create a user account from VB in SQL 2008. I have never worked with SQL out of VB before, so I'm not even sure on the basics to do this. I just need to create a User Account with admin rights in SQL 2008. I know how to do the queries for SQL to do it, but not sure if there is an easy way to run them in VB.net? Basically all I need to do is run the following SQL Query, but from my VB program:
Is there an easy way to do this? My SQL Instance name is the standard MSSQLSERVER, and the account this VB.net program is running from is an administrator in SQL already if that helps any.
Thank you anyone who can help me out!
I have been looking around for this for awhile, and haven't come up with any way to just simply create a user account from VB in SQL 2008. I have never worked with SQL out of VB before, so I'm not even sure on the basics to do this. I just need to create a User Account with admin rights in SQL 2008. I know how to do the queries for SQL to do it, but not sure if there is an easy way to run them in VB.net? Basically all I need to do is run the following SQL Query, but from my VB program:
Code:
create login User1 with password = 'Password1';
GO
EXEC sp_addsrvrolemember 'User1', 'sysadmin';Thank you anyone who can help me out!