Thanks for your reply. My select statemnet is very simple for testing.
using (SqlDataAdapter adapter = new SqlDataAdapter("select id, f1 from table_1 where id = '1'", sqlConnection)) //Make sure that your xxx table must have a primary key
{
SqlCommandBuilder sub = new SqlCommandBuilder(adapter);
SqlCommand cmd = sub.GetUpdateCommand();
}
id field is the PK of this table. It show the same error.
My SQL environment :
Server 1: Microsoft SQL Server 2008 R2 (RTM) - 10.50.1600.1 (X64) (Build 7601: Service Pack 1)
This is the primary server and built an synonyms table to Server 2
Server 2: Microsoft SQL Server 2000 - 8.00.2040 (Intel X86) (Build 3790: Service Pack 2)
wilsonwu
Member
59 Points
86 Posts
Re: SqlCommandBuilder GetUpdatecommand error for synonyms table
Feb 27, 2012 07:14 AM|LINK
Hi,
Thanks for your reply. My select statemnet is very simple for testing.
using (SqlDataAdapter adapter = new SqlDataAdapter("select id, f1 from table_1 where id = '1'", sqlConnection)) //Make sure that your xxx table must have a primary key
{
SqlCommandBuilder sub = new SqlCommandBuilder(adapter);
SqlCommand cmd = sub.GetUpdateCommand();
}
id field is the PK of this table. It show the same error.
My SQL environment :
Server 1: Microsoft SQL Server 2008 R2 (RTM) - 10.50.1600.1 (X64) (Build 7601: Service Pack 1)
This is the primary server and built an synonyms table to Server 2
Server 2: Microsoft SQL Server 2000 - 8.00.2040 (Intel X86) (Build 3790: Service Pack 2)
Thanks
Wilson