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

后端 未结 4 1078
南旧
南旧 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 08:04

    If the database is local with the application you can use LocalHost in your connection string assuming all other information is the same.

    Eg:

    string connectionString = @"server = LOCALHOST\SQLEXPRESS; Integrated Security = SSPI; database = XPHotelManagementDatabase";
    

提交回复
热议问题