Sal-laS
Sal-laS

Reputation: 11639

Connection string without User Id or Password

I have defined a database with no username and password in SQL Server. Here is my connection string where I do not know what I should set in my User Id and password:

db = new SqlConnection("Server=localhost;Database=Scheduling_Employee;User ID=;Password=;");

Upvotes: 1

Views: 39095

Answers (2)

Consult Yarla
Consult Yarla

Reputation: 1150

Can use the trusted connection,

for example,

Server=.\SQLEXPRESS;Database=myDB;Trusted_Connection=True;

Refer to this url for all other combinations http://www.connectionstrings.com/

Upvotes: 10

DD84
DD84

Reputation: 383

For your local machine you should be able to set the parameter Integrated Security = true;

That would allow you to use the windows authentication.

Upvotes: 2

Related Questions