HighTechTalks DotNet Forums  

Batch updates on generated TableAdapters throws InvalidOperation

Dotnet Framework (ADO.net) microsoft.public.dotnet.framework.adonet


Discuss Batch updates on generated TableAdapters throws InvalidOperation in the Dotnet Framework (ADO.net) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Some Bloke
 
Posts: n/a

Default Batch updates on generated TableAdapters throws InvalidOperation - 12-18-2007 , 06:44 AM






Hi,

I'm trying to write a data layer for to persist regularly occuring
stats to a database using ADO.NET by collecting a few records then
updating the database in batches.

I've got a Dataset that is generated with MSDataSetGenerator that I
add rows to then pass to the Update method of the generated
TableAdapter.

When I set the batch size to anything more than 1, I get "When
batching, the command's UpdatedRowSource property value of
UpdateRowSource.FirstReturnedRecord or UpdateRowSource.Both is
invalid"

Doing a search for that exception returns no results, hence me asking
for help, but looking into it I see that UpdateRowSource.Both is the
default value but the generated InitAdapter() method of the
TableAdpater that creates the update/insert commands doesn't override
this, leading to the exception.

Strangely this did appear to be working at one point but I can not
figure out what has changed.

How can I get the code generator to set the UpdateRowSource to None?
Or is there something that I could have missed that would cause this?
Possibly a change to the database?

Thanks for any help.



Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.