Unable to create connectionstring for a remote desktop for a C# application

后端 未结 2 1382
情歌与酒
情歌与酒 2020-12-12 03:16

I want to create a Windows service which will copy data from one database to another database. The source database is in a remote location, below is the function using

2条回答
  •  隐瞒了意图╮
    2020-12-12 03:53

    Try to do telnet localhost 1433 from command prompt (from the same server where SQL services running), if the connection accepted without any error, then your SQL server really ready to accept connections. Otherwise follow these steps to troubleshoot the issue:

    • Make sure TCP/IP protocol enabled
    • Verify if the custom port configured (via SQL Server Configuration manager) for SQL Express service (as per screenshot)

    If the custom port NOT configured

    1. Make sure SQL Browser service is running
    2. Create a rule in Windows Firewall to accept incoming connections on TCP ports 1433 and 1434 (TCP and UDP)
    3. Restart SQL Browser service
    4. Do telnet localhost 1433 again to verify

    If the custom port configured

    1. Create a rule in Windows Firewall to accept incoming connections on Custom TCP ports
    2. Restart SQL service
    3. Do telnet localhost to verify
    4. Change the connection string to DataSource = "ABCKOL-BCKOFF,"

提交回复
热议问题