程序代码:
String constr = "data source=192.168.2.178;Initial Catalog=shiyan;integrated security=SSPI";
SqlConnection con = new SqlConnection(constr);
String sql = "select * from wlyhb where name='admin'";
SqlCommand com = new SqlCommand(sql, con);
con.Open();
String constr = "data source=192.168.2.178,这是需要远程连接吗?建议现在电脑上查看是否开启远程连接