I get an error when I try to execute the following code using ADO.Net
in VB.Net:
conn.open
sqlString="CREATE LOGIN test WITH PASSWORD = '1qaz2wsx'"
command=new SqlCommand(sqlString)
command.connection = conn
command.ExecuteNonQuery()
The error occurs when executing the ExecuteNonQuery line and is:
"Line1: Incorrect syntax near 'LOGIN' "
The database connection is connected to the master database of SQL 2005
Express using the sa account. This line executes just fine in Sql
Server Studio Manger when connected as sa. Am I not allowed to create
database logins via ado.net?!?! I need to for my application.
Thx,
Marcus