Does anyone know how to determine the security mode (Mixed Mode or Windows Authentication) in .NET?
EDIT: I am using normal ADO.NET objects (SqlConnection, SqlCommand, etc) to connect to the database.
Thanks for any and all advice.
Steve
Does anyone know how to determine the security mode (Mixed Mode or Windows Authentication) in .NET?
EDIT: I am using normal ADO.NET objects (SqlConnection, SqlCommand, etc) to connect to the database.
Thanks for any and all advice.
Steve
You can query the registry!
DECLARE @LoginMode int
EXEC master..xp_regread
@rootkey = 'HKEY_LOCAL_MACHINE',
@key = 'SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.1\MSSQLServer\',
@value_name = 'LoginMode',
@value = @LoginMode output
PRINT @LoginMode
1 = SQL
2 = Mixed
The @key
may be different depending on your installation. I have a couple instances running.