.NET Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgramming.NET Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old February 10th, 2005, 01:02 AM
dr_maq dr_maq is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 1 dr_maq User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 12 m 14 sec
Reputation Power: 0
Exception: Primary key information is not present

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["SECURITY_GROUP_ROLES"].Columns["GROUP_ID"];
keys[1] = dsRole.Tables["SECURITY_GROUP_ROLES"].Columns["ROLE_TYPE"];
keys[2] = dsRole.Tables["SECURITY_GROUP_ROLES"].Columns["CATEGORY_ID"];

keys[3] = dsRole.Tables["SECURITY_GROUP_ROLES"].Columns["FORUM_ID"];

dsRole.Tables["SECURITY_GROUP_ROLES"].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


Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgramming.NET Development > Exception: Primary key information is not present


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway