inserting row in dataset PB

F

fh

Hello,
I use a typed dataset in one table I have

this.columnID.AutoIncrement = true;

I thought that would let the dataset dealing with the generation of
primary key.

but when I insert a new datarow that way:
DataRow drDowntimeSup = _dsDowntime.Tables["PPE_DOWNTIME"].NewRow();
drDowntimeSup.BeginEdit();
drDowntimeSup.ItemArray= drCurentLine.ItemArray;
//drCurentLine is an existing line
.......... I change some columns, not the "ID" column.

drDowntimeSup.EndEdit();
_dsDowntime.Tables["PPE_DOWNTIME"].Rows.Add(drDowntimeSup);

I receive the following:

->Column 'ID' is constrained to be unique. Value '33771' is already present.

Am I missing something?

thank you
Franck
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,067
Latest member
HunterTere

Latest Threads

Top