tI'm using Sql Server with Windows Authentication enabled. Recently I added a dropdown to allow for different connections. One of them uses SQL Authentication.
I consulted msdn and it seems all I need to do is add a Username and Password entry to my string.
http://msdn.microsoft.com/en-us/library/aa905872(v=sql.80).aspx
My windows authentication string :
Data Source=PC\Slike;Initial Catalog=db_slike_articles;Integrated Security=True
The second string I added for SQL Authentication :
Data Source=Data Source=PC\Dev;Initial Catalog=db_dev_articles;Integrated Security=True;User ID=root;Password=rootpwd
For some reason when I choose the 2nd SQL connection it's throwing an SqlException that login failed with my PC\Slike username. The connection string is the second one with the User ID and Pwd, I don't understand why it's trying to connect against my local account.
The second string is located on a remote machine, is there something I have to enable to switch from Windows Auth to Sql Auth or does specifying the the credentials within the string is enough?
Thanks
Integrated Security=Truein there, so Windows Auth is probably still going to be used. You should perhaps remove it to see if that changes things