Sakthimurugan K

Sakthimurugan K

  • NA
  • 1
  • 1.1k

Not able to connect C# exe with SQL Server

Apr 2 2016 3:03 AM
My goal is to create a stand-alone C# Windows form application which will connect to SQL Server. 
I have to deploy this stand-alone file in different client machine.
 
Consider, i have two machine - Machine A and B.
 
in Machine A, i have installed SQL Server 2008 R2 and VS2013 for development.
 
Connection string i have used for development:  "Data Source=AssetName\SQLEXPRESS;Initial Catalog=Test_Database;Integrated Security=True" which is working fine in Machine A. when i tried same on Machine B it is not connecting to the Sql Server on Machine A.
 
When i searched on internet, i got many references suggesting to use Service-Based Database in VS. however i am finding difficult to understand how service-based database is working. i couldn't see any connectivity between the server and service-based database. can anyone help me to on this..
 
Also please let me know to connect the SQL Server on Machine A do i need to SQL Server Management Studio on Machine B??? 
 
 
 Error msg:
System.Data.SqlClient.SqlException (0x80131904): A network-related or instance-specific error occurred while extablishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections.  
 
 
 

Answers (3)