app.config file in C# for SQL Server 2005 in VS 2008

后端 未结 4 1112
南旧
南旧 2021-01-20 07:03

I have C# .net project with SQL Server 2008 written in Visual Studio 2008. There I used the following connection string to connect with SQL Server:

string co         


        
4条回答
  •  灰色年华
    2021-01-20 07:47

    Aside from LOCALHOST and "." You can

    1. use "server = 127.0.0.1\SQLEXPRESS"

    2. Add an alias to the SQL Server Configuration Manager and use that in your string

    3. add 127.0.0.1 foo to your hostsfle and use it e.g. "server = FOO\SQLExpress"

    4. Mange the connection in the machine config

提交回复
热议问题