Sql server sql数据库和windows服务之间的连接

Sql server sql数据库和windows服务之间的连接,sql-server,database,windows-services,Sql Server,Database,Windows Services,有谁能帮助我使用连接字符串了解如何从windows服务在sql数据库之间建立连接吗?如果您使用的是ADO.NET,请阅读SqlConnection的属性。例如: var connStr = "SERVER=SomeServer;DATABASE=MyDb;Integrated Security=true;"; using (var db = new SqlConnection(connStr)) { db.Open(); // other data access command

有谁能帮助我使用连接字符串了解如何从windows服务在sql数据库之间建立连接吗?

如果您使用的是ADO.NET,请阅读
SqlConnection
的属性。例如:

var connStr = "SERVER=SomeServer;DATABASE=MyDb;Integrated Security=true;";
using (var db = new SqlConnection(connStr)) {
    db.Open();

    // other data access commands here
}