TableAdapters.Update()

C

Chris Lim

I'm new to VS 2005 (actually .NET in general) and have just been
playing with some simple forms to access/update data in a SQL Server
database.

I have a DataGridView on the form and am currently writing changes back
to the db using the Update() method of the TableAdapter. This seems to
work fine, except I want the application to behave such that if errors
occur on any row then it rolls back all the changes (e.g. if 5 rows are
updated and 1 of them fails, it should roll back changes to all 5
rows).

Is there anything built-in to handle this, or would I have to manually
add transaction handling surrounding the Update()?
 
J

Jake K

You will have to build the transaction as part of your .net code or use a
SQL stored procedure and transaction code (begin, commit, rollback).
 

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

Top