插入表中从另一个计算机表中选择*

时间:2016-09-28 16:04:07

标签: c# sql-server sql-server-2008

我在本地网络中有两台计算机我想从一个表插入从PC(A)到其他表PC(B)这里是一个例子:

SqlConnection con = new SqlConnection(@"Data Source=(local);Initial Catalog=Db;User ID=sa;password=xxxxx");
SqlConnection conn = new SqlConnection(@"Data Source=(local);Initial Catalog=Db;User ID=sa;password=xxxxx");

SqlCommand cmd8 = new SqlCommand("insert into [192.168.1.11].Db.dbo.MArket select * from MARKET", conn);//second market is been exist in my local database,too
                cmd8.ExecuteNonQuery();

0 个答案:

没有答案