我用.net连接SQL2000,一直连不上,数据库用户名是pizixi密码是:pipizi$&521字符串如下<appSettings>
<add key="connStrJhnews" value="Server=228.158.17.126;uid=pizixi;pwd=pipizi$&521;database=pipito" />
</appSettings>说明:由于密码中含&,我就转意成&还有我,我把数据库日志文件名的小写改成了大写,会不会影响?
<add key="connStrJhnews" value="Server=228.158.17.126;uid=pizixi;pwd=pipizi$&521;database=pipito" />
</appSettings>说明:由于密码中含&,我就转意成&还有我,我把数据库日志文件名的小写改成了大写,会不会影响?
System.Data.SqlClient.SqlException: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
配置管理器 启用tcp/ip服务
------------------------------------那还是包含了“&”, 最好不要在webconfig的数据库密码中出现这个
2.打开允许远程连接,在sql2005是到外围设置下TCP/IP
检查数据库远程连接是否开启,端口是否缺省1433