string ConnectionString = "Data
Source=192.168.1.103;Initial Catalog=数据库名;Persist Security Info=True;User ID=数据库用户名;Password=密码";
SqlConnection conn=new SqlConnection(ConnectionString);
string ConnectionString = "Data
Source=192.168.1.103;Initial Catalog=数据库名;Persist Security Info=True;User ID=数据库用户名;Password=密码";
SqlConnection conn=new SqlConnection(ConnectionString);
如果Data Source=192.168.1.103;用的不是标准的sqlserver端口还要加上端口号类似
Data Source=192.168.1.103:1533;
Provider=SQLOLEDB;Server=192.168.1.101;database= 数据库名;User ID=sa;Password=密码;