Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hello, I have a table with over 100 fields. What I need to do right now is have a function that will copy an existing record into the same table. Only one field will change which is the primary key.

 

Is there a way to copy to a record with out selecting all the contents into a dataset and then reinserting the values.

 

Thanks for any input.

Posted
I assume that solving it with a dataset wouldn't be to hard. You could probable itterate through the row with some kind of loop. But why would you like to create redundant data in the database. One of the first advices in creating relational databases would be to avoid 'double' data.
qrt
Posted

The reson why I have to do this is the user needs to be able to copy an existing record and change a few minor details at a later time. It will rarely happen but they need that functionality. I dont like it either.

 

So I got the data into a dataset and i have it where it changed the field that has to be changed. But where I am having trouble now is the update. Since I am updating the same table and the dataset is set for the old record, will it automatically insert the new record?

 

Thanks

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...