Connecting to SQL Server instance through C#
You may need to use SQL Server Configuration Manager to enable TCP/IP connections.

The default is disabled, as below.  You must enable TCP/IP to allow remote connections to the SQL Server machine.