Click here to Skip to main content
14,970,229 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm Using SQL Server 2012 Express & VB.Net

On my development machine everything is perfect with with SQL Server 2012 LocalDB as data source

Localdb Connection String:
"Data Source=(LocalDB)\v11.0;Integrated Security=true;AttachDbFileName=C:\TestData\Test.Mdf"

On the testing machine with SQL Server 2012 Express everything went perfectly on same pc on which SQL Server was installed

SQL Server Express Connection String.
1. Attach DB File
'For Connection
"Server=.\SQLEXPRESS;Initial Catalog=Master;Trusted_Connection=Yes;"
'For Attaching DB File to above Connection
"exec sp_attach_db @dbname='Test', @filename1='C:\TestData\Test.Mdf', @filename2='C:\TestData\Test.ldf'"

2. Connect to DB File Attached Already
"Server=.\SQLEXPRESS;Integrated Security=true;Database=Test"

Everything went perfectly with above details.
Now I connect from another PC and it gave me an error
Invalid Username & Password

What should I do?

Please help

1 solution

Provide the correct username and password.
Normally, development machines use "Integrated Security=True" because the instance is local to the app being tested: for production DB systems, that is a lot less normal because you need to restrict who can do what to which database: You don't want everybody having access to sensitive information such as address lists for example, because there are legal restrictions in most companies on how available such info is (in the UK it's called the Data Protection Act).

So you need to talk to whoever administers your production DB server, and get a "proper" username and password from him - which you can then use in your application.
A N Saraf 12-Jun-14 9:23am
Thanks for your help. received username & password and was able to connect using the same
OriginalGriff 12-Jun-14 10:26am
You're welcome!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900