且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用ASP.NET连接到数据库时出现问题

更新时间:2022-06-18 23:59:17

1 / >

< / rewriter >

< system.web >
< webServices >
< 协议 >
< 添加 名称 = HttpGet / >
< add name = HttpPost / >
< / protocols >
< / webServices >
< sessionState 超时 = 90 / >
&lt ; / system.web >

< / configuration >
1"/> </rewriter> <system.web> <webServices> <protocols> <add name="HttpGet"/> <add name="HttpPost"/> </protocols> </webServices> <sessionState timeout="90" /> </system.web> </configuration>





我尝试过:



< connectionStrings>

< remove name =LocalSqlServer/>

< add name =LocalSqlServerconnectionString =Data Source = 212。 ....,1433;网络库= DBMSSOCN;初始目录=训练;持久安全信息=真;用户ID = sa;密码= 123;最大池大小= 100;

providerName = System.Data.SqlClient/>

< / connectionStrings>



What I have tried:

<connectionStrings>
<remove name="LocalSqlServer" />
<add name="LocalSqlServer" connectionString="Data Source=212. ....,1433;Network Library=DBMSSOCN;Initial Catalog=training;Persist Security Info=True;User ID=sa;Password=123;Max Pool Size=100;"
providerName="System.Data.SqlClient" />
</connectionStrings>


可能是用户名和密码错误:非常错误。

您不应该使用 sa 帐户,当然也不应该使用共享主机服务。请联系您的新主机,找出您应该使用的ID和密码使用:如果所有网站都使用sa帐户登录到同一个SQL服务器,因为对该网站上的所有数据库都具有完全访问权限,而不仅仅是与该网站相关联的数据库,我会感到非常不满......
The chances are that the username and password are wrong: very wrong.
You should not be using the sa account, and certainly not on a shared hosting service. Contact your new hosts, and find out what id and password you should be using: I for one would be most unhappy if all websites logged into the same SQL server using the sa account as that has full access to all databases on there, not just the ones associated with that web site...