How to pass connection string that has a backward slash to SqlConnection?

后端 未结 2 1767
南旧
南旧 2021-01-18 13:37

I am trying to call the stored procedure using C#.

I am facing problem in the following line.

SqlConnection(\"Server=DB2\\XPT;DataBase=SCFHP_EDI_P1;         


        
2条回答
  •  太阳男子
    2021-01-18 14:15

    ("Server=DB2\\XPT;DataBase=SCFHP_EDI_P1;Integrated Security=SSPI");
    

    or

    (@"Server=DB2\XPT;DataBase=SCFHP_EDI_P1;Integrated Security=SSPI")
    

提交回复
热议问题