The right connection string for Remote SQL server for C#

前端 未结 3 1437
情话喂你
情话喂你 2020-12-25 09:04

I just want to know the right sql connection string for a remote sql server express edition.

This is what I got but I got some problems

 SqlConnectio         


        
3条回答
  •  攒了一身酷
    2020-12-25 09:13

    Solution : if you are providing remote machine IP address then you don't need to provide hostname

    Try This:

    SqlConnection cs = new SqlConnection(@"Data Source=(IP Address)\SQLEXPRESS,1433;Network Library=DBMSSOCN;Initial Catalog=dbase;User ID=sa;Password=password");
    

提交回复
热议问题