On the web. config node <connectionstrings>, add
<Configuration>
<Connectionstrings>
<Add name = "connectionserver" connectionstring = "Data Source = 192.168.133.30 (server address); initial catalog = shuidian (Database Name); persist Security info = true; user ID = SA (User Name); Password = (password); "/>
</Connectionstrings>
</Configuration>
Call method: configurationmanager. connectionstrings ["connectionserver"]. connectionstring;
For local access, you can set data source = .;
The Internet test cannot be performed because my network belongs to the LAN.
If the data server does not open port 1433 in the C/S structure, change the port, for SQL Server 2005, modify the SQL Server TCP port in SQL Server Configuration Manager to an available port, for example, 8000, and restart the SQL Server service. Client uses "Server = XXXXX. XXX. XXX. XX, 8000; database = xxx; uid = xx; Pwd = xx ",
It should be accessible.