SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Changing connection authentication


Changing connection authentication

Author
Message
maylar
maylar
SSC-Enthusiastic
SSC-Enthusiastic (189 reputation)SSC-Enthusiastic (189 reputation)SSC-Enthusiastic (189 reputation)SSC-Enthusiastic (189 reputation)SSC-Enthusiastic (189 reputation)SSC-Enthusiastic (189 reputation)SSC-Enthusiastic (189 reputation)SSC-Enthusiastic (189 reputation)

Group: General Forum Members
Points: 189 Visits: 31
Using SQL Server 2014 Express, the initial install was set to use Windows Authentication. I'd like to change that to SQL Server Authentication with a user name and password.
Is that possible, and if so how do I do that from within the Management Studio IDE?

Also, I'm accessing the DB through a C# application. How would the connect string change once there's a user name / password set? Currently I have these values:


LocalDatabaseName = computername + "\\SQLEXPRESS"; // where computername is System.Windows.Forms.SystemInformation.ComputerName, and
string connstring = "Data Source=" + LocalDatabaseName + ";Initial Catalog = master;Integrated Security=True";


Thanks.

Sue_H
Sue_H
SSC-Forever
SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)

Group: General Forum Members
Points: 47426 Visits: 12313
maylar - Tuesday, January 30, 2018 7:18 AM
Using SQL Server 2014 Express, the initial install was set to use Windows Authentication. I'd like to change that to SQL Server Authentication with a user name and password.
Is that possible, and if so how do I do that from within the Management Studio IDE?

Also, I'm accessing the DB through a C# application. How would the connect string change once there's a user name / password set? Currently I have these values:


LocalDatabaseName = computername + "\\SQLEXPRESS"; // where computername is System.Windows.Forms.SystemInformation.ComputerName, and
string connstring = "Data Source=" + LocalDatabaseName + ";Initial Catalog = master;Integrated Security=True";


Thanks.


In SSMS, right click on the instance name, select properties. Then select the Security page. The authentication is the first section where you can set it to SQL Server and Windows authentication mode.

For the connection string, remove the Integrated Security=True and replace it with User ID=UserName;Password=UserNamePassword;

Sue



maylar
maylar
SSC-Enthusiastic
SSC-Enthusiastic (189 reputation)SSC-Enthusiastic (189 reputation)SSC-Enthusiastic (189 reputation)SSC-Enthusiastic (189 reputation)SSC-Enthusiastic (189 reputation)SSC-Enthusiastic (189 reputation)SSC-Enthusiastic (189 reputation)SSC-Enthusiastic (189 reputation)

Group: General Forum Members
Points: 189 Visits: 31
Just wanted to say thank you, Sue.
Dave.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum








































































































































































SQLServerCentral


Search