WCF:SqlConnectionStringBuilder 中没有密码 - 为什么它有效?
WCF : No password in SqlConnectionStringBuilder - why does it work?
我有这样的连接字符串生成器:
SqlConnectionStringBuilder connStringBuilder = new SqlConnectionStringBuilder
{
DataSource = "NAMEofSERVER",
InitialCatalog = "NAMEofDATABASE",
Encrypt = true,
TrustServerCertificate = true,
ConnectTimeout = 60,
AsynchronousProcessing = true,
MultipleActiveResultSets = true,
IntegratedSecurity = true
};
而且我没有权限 "password" 所以我的 wcf 服务怎么可能与我的 SQLServer 数据库良好连接? (我可以执行插入和更新)。
这是因为它在同一台计算机上(我的服务 WCF 和我的数据库)或者它只在本地,当我要共享我的 wcf 时连接会被拒绝?
默认情况下,它认为您的 windows 身份验证可以登录您的 SQLServer,因此在这种情况下您不需要用户 ID 和密码。但是,如果您的 windows 身份验证在服务器中被禁止,那么即使使用您的 windows 身份验证也不允许登录。
我有这样的连接字符串生成器:
SqlConnectionStringBuilder connStringBuilder = new SqlConnectionStringBuilder
{
DataSource = "NAMEofSERVER",
InitialCatalog = "NAMEofDATABASE",
Encrypt = true,
TrustServerCertificate = true,
ConnectTimeout = 60,
AsynchronousProcessing = true,
MultipleActiveResultSets = true,
IntegratedSecurity = true
};
而且我没有权限 "password" 所以我的 wcf 服务怎么可能与我的 SQLServer 数据库良好连接? (我可以执行插入和更新)。
这是因为它在同一台计算机上(我的服务 WCF 和我的数据库)或者它只在本地,当我要共享我的 wcf 时连接会被拒绝?
默认情况下,它认为您的 windows 身份验证可以登录您的 SQLServer,因此在这种情况下您不需要用户 ID 和密码。但是,如果您的 windows 身份验证在服务器中被禁止,那么即使使用您的 windows 身份验证也不允许登录。