Solved

ado.net flag an existing row as a new row

Posted on 2011-09-15
1
293 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VB.NET 2008 (3.5 Framework) Remove all items from List 3 32
Help with error in Query 2 31
MailAddress in vb 4 29
Passing data between Forms 3 20
Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

809 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