PC Review Forums Newsgroups Microsoft DotNet Microsoft ADO .NET trouble with primary key element in a dataset

Reply

trouble with primary key element in a dataset

 
Thread Tools Rate Thread
Old 25-08-2003, 02:58 PM   #1
Filip De Backer
Guest
 
Posts: n/a
Default trouble with primary key element in a dataset


Hi,

I've got a dataset containing two elements in a table
called tblCollection: Collection_ID and CollectionName.
Collection_ID is an int (not an autonumber).

In my stored procedure that inserts a new record, I create
a new unique id. I use 4 stored procedures to get and save
the data because I want to perform some tests.

So I bind the dataset to a datagrid (I only show the
Collection column), but I can't insert any new row because
of the null value of the Collection_ID, even when I set
the nullability true in the dataset properties of that
Collection_ID element.

When I use default value 0, I can only create one new
record because (offcourse) the Collection_ID must be unique

Has anybody a solution?

Thanks a lot,

Filip
  Reply With Quote
Reply



Thread Tools
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