It installed automatically with Visual Studio 2010 Ultimate. I didn't create any users for the server or ANYTHING.
I'm using:
string connectionString = @"Server=.\SQLEXPRESS;Database=SportsStore;Trusted_Connection=yes;";
I get error that authentication failed. So the server is being found, but my credentials are wrong. What would the default login and password be?
Edit: Still not working! :(
Here's my connection string:
string connectionString = @"Server=.\SQLEXPRESS;Database=SportsStore;Integrated Security=SSPI;";
And the error message:
Cannot open database "SportsStore" requested by the login. The login failed. Login failed for user 'ToshibaLaptop\Sergio'.
You probably should not connect using Sql Server Authentication.
Log in as an Administrator on the box, connect using Integrated Windows Authentication, and you should be a system admin.
If you are using SQL Server authentication you could try the username sa
and blank password but I am not sure whether this is by default. Integrated Windows authentication should work, so you should be able to connect with your Windows account:
string conn = "Data Source=.\SQLExpress;Initial Catalog=mydb;Integrated Security=SSPI;";
The error message indicates that SQL Server can't open the database. I think you're successfully authenticating, but having a problem connecting to the database. Is the database available?
You can do a test by changing the database to master in your connection string. If that succeeds, then you're problem is related to the database. I understand that you may get other errors, but the test is to confirm that you can login to SQL Server.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With