0
任何人都可以帮助我使用连接字符串来获取从Windows服务的SQL数据库之间的连接吗?SQL数据库和Windows服务之间的连接
任何人都可以帮助我使用连接字符串来获取从Windows服务的SQL数据库之间的连接吗?SQL数据库和Windows服务之间的连接
如果您使用ADO .NET,请阅读ConnectionString
属性SqlConnection
。例如:
var connStr = "SERVER=SomeServer;DATABASE=MyDb;Integrated Security=true;";
using (var db = new SqlConnection(connStr)) {
db.Open();
// other data access commands here
}