c# 2008 SQL Server Express Connection String

后端 未结 5 922
无人及你
无人及你 2020-12-20 19:02

I have a 2008 SQL Server Express installed on one of my machines and I\'m attempting to establish a remote connection... when I use the MS SQL Server Management Studio I can

相关标签:
5条回答
  • 2020-12-20 19:45

    It could be your SQL instance is not cobfigured to accept incoming TCP connections, you can check this under Start-> SQL Server 2008 -> Conguration Tools -> SQL Server Configuration Manager. On the left side in that tool you'll see network configuration, expand it to see which protocols are enabled.

    0 讨论(0)
  • 2020-12-20 19:46

    What if you use Integrated Security=SSPI?

    If you are not wanting to use a windows login I believe the other answer about removing the Integrated Security parameter is correct.

    0 讨论(0)
  • 2020-12-20 19:48

    Ok - I am guessing you have tried all of these http://blogs.msdn.com/sqlexpress/archive/2005/05/05/415084.aspx

    Have you tried sqlping on MACHINENAME\SQLEXPRESS

    Can you ping MACHINENAME

    Finally, I am pretty sure you only need 1 slash i.e. MACHINENAME\SQLEXPRESS

    0 讨论(0)
  • 2020-12-20 19:51

    try this

    string sqlcon=("Data Source="your pc name\\SQLEXPRESS"; 
    UserID=sa;
    Password=****;
    Initial Catalog="+MyDatabase+"; 
    IntegratedSecurity=True;");
    
    0 讨论(0)
  • 2020-12-20 20:04

    Remove Integrated Security=True from your connection string and (optional) add Persist Security Info=True;

    From MSDN:

    Integrated Security - When false, User ID and Password are specified in the connection. When true, the current Windows account credentials are used for authentication.

    0 讨论(0)
提交回复
热议问题