Solved

ado.net flag an existing row as a new row

Posted on 2011-09-15
1
280 Views
Last Modified: 2012-05-12
I wish to read in an order from last week, change the date and maybe a couple of other things then write it out as a new order.

I have tried setting the Id to -1 but that doesn't work - all that I get is Error Concurrency Violation.

It does work if I manually create a new datatable using NewRow which I can continue to do if necessary, but it would be a lot easier if I could simply fill the DataTable, change my values and apply the Update() method.
0
Comment
Question by:grwallace
1 Comment
 

Accepted Solution

by:
grwallace earned 0 total points
ID: 36542071
Use row.SetAdded() after filling the dataset and before changing any of the columns
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now