I want to run a Transact SQL statement from within C# in order to create a login to SQL Server. It is important that I do it inside the code, without executing a .sql file from outside the program. How do I do that?
Following is the T-SQL statement I am going to use, which basically create a Windows Authentication based Login to SQL Server.
CREATE LOGIN [<domainName>\<loginName>] FROM WINDOWS;
GO
Help is greatly appreciated.