AoA Dears,
i m having a problem with inserting value in SQL Server 2000 through C# Code
the table in which i m going to insert values have a composite primary key(combination of 4 DataColumns)
when i load DataSet, i set these four DataColumns as primary key using following C# code
DataColumn[] keys = new DataColumn[4];
keys[0] = dsRole.Tables["SECURITYGROUPROLES"].Columns["GROUPID"];
keys[1] = dsRole.Tables["SECURITYGROUPROLES"].Columns["ROLETYPE"];
keys[2] = dsRole.Tables["SECURITYGROUPROLES"].Columns["CATEGORY_ID"];
keys[3] = dsRole.Tables["SECURITYGROUPROLES"].Columns["FORUM_ID"];
dsRole.Tables["SECURITYGROUPROLES"].PrimaryKey = keys;
when i update existing record in this table, it works fine. but when i insert new record in this table, it gives an error at Updateing DataSet that
[SqlServerCommandBuilder] ConcreteGetInsertCommand()Primary key information is not present
i have already set primay key but why its giving this error
Can any body tell me the solution of this problem
One point more. DataTable that have a single column as primary key, are working fine. But having composite key is not working fine
waiting for ur urgent reply
Thanks in advance
Maqsood Ahmad
No one has replied yet! Why not be the first?
Sign in or Join us (it's free).