我的数据库托管在远程服务器上。我需要编写连接字符串并将其包含在web.config
文件中。
server name -- abcs.efgh.ed-1.eee.sss.com,1433 (it also contains a port as well)
username -- a
password -- a
db name -- mydb
我知道如何连接本地数据库,并且我通常会参考connectionstring.com,但是连接到远程数据库对我来说是一个问题。请帮忙。
更新:
<connectionStrings>
<add name="DefaultConnection" providerName="System.Data.SqlClient"
connectionString="abcs.efgh.ed-1.eee.sss.com,1433;Integrated Security=True;User ID=a;Password=a" />
</connectionStrings>
我收到的异常信息是:
登录失败。该登录来自不受信任的域,不能与Windows身份验证一起使用。
实际上,我想要使用的不是Windows身份验证,而是SQL Server身份验证。