Click here to Skip to main content
15,899,754 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
This is the scenario.I'm creating a desktop application with VB.NET (Windows Forms), and using SQL Server 2008 r2 for its database.I have two computers(PC1 and PC2) and I want to connect PC2 to PC1 . PC 1 has the microsoft sql server database. What i do is i just copied .exe application in the debug folder of my vb project and create a notepad for its connection and put them into one folder and transfer it to PC2.

When i run my appplication to other PC, I got an error of

Unhandled exception has occured in your application. If you click Continue, the application will ignore this error and attempt to continue, If you click quit, The application will close immediately.

Cannot open database "DatabaseName" requested by the login. The Login failed. Login failed for user


My code inside the notepad

VB
Data Source=PC1;Initial Catalog=DBSAS;Integrated Security=True


Can someone please give me an advice about this. I am really confuse. Thanks

What I have tried:

What i have done so far is to enable remote connection of SQL server 2008.
Posted
Updated 3-May-16 11:08am
Comments
PIEBALDconsult 2-May-16 0:06am    
Are you in an Active Directory domain? If not, I don't think you can use Integrated Security.
Other than that, ensure that the proper port is open on the "server".
Herman<T>.Instance 2-May-16 7:17am    
set Integrated Security=SSPI
Diether Silverious 2-May-16 20:47pm    
i have tried this ,,set Integrated Security=SSPI. But not working
an0ther1 2-May-16 23:02pm    
As PIEBALDconsult has said already, are you on a domain? If so you need to ensure the User running the application has access to the database you are attempting to connect to.
If not, you will need to use SQL Authentication and pass a Username & Password as part of your connection string.
Refer to http://www.connectionstrings.com/sql-server/ for Connection String information

Kind Regards

1 solution

hi

It sims you are using Windows authentication to connect to the database
try using sql authentication i find it more convenient for remote connectivity
 
Share this answer
 

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