473,396 Members | 2,068 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

TableAdapters.Update()

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()?

Dec 21 '06 #1
2 2285
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).
"Chris Lim" <bl********@hotmail.comwrote in message
news:11**********************@t46g2000cwa.googlegr oups.com...
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()?
Dec 21 '06 #2
Take a look at this:
http://msdn2.microsoft.com/en-us/ms973865.aspx

chanmm

"Chris Lim" <bl********@hotmail.comwrote in message
news:11**********************@t46g2000cwa.googlegr oups.com...
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()?
Dec 21 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Christopher Kimbell | last post by:
I have a class library that contains a number of TableAdapters and I'm using this from a web application. Is there a way of getting the TableAdapters to use the connectionstrings defined in...
3
by: dbuchanan | last post by:
Hello, How do I create a Parent-Child relationship between two DataGridView in a form using TableAdapters. The two tables already have a relationship defined in the dataset. What event do I...
0
by: spooke | last post by:
HI all now are two days, 20 hours of work that i'm on this problem without a solution!!! I think i'll become mad!!! Here is the problem: I Use C# 2.0 (VS .Net 2005) with thyped dataset I...
1
by: H5N1 | last post by:
hi there the topic says it all. I have a outer join select statement in tableadapter that populates GridView, I want to make it updatetable, so I need to provide an update command for table...
7
by: CMM | last post by:
Unless someone has come up with a way, I still don't understand how you can use TableAdapters in a true n-tier infrastructure.... where the DataAccessLayer is in one Dll and *only* the Datasets...
1
by: Nick Gilbert | last post by:
Hi, I have a database table which has some "float" columns which allow nulls. I have created a TableAdapter to view this table. If I open the TableAdapter and there are null values for some of...
0
by: DG | last post by:
How to update TableAdapters using tranasactions? is this a good sample? http://www.mybug.bloger.hr/post/tableadapters-and-transactions/179426.aspx
7
by: =?Utf-8?B?R3JlZw==?= | last post by:
When using the VS Wizards to create a DataSet I select tables. Then, I use the TableAdapter Configuration Wizard to modify the underlying queries that retreive the data. What I'm wonder is, does...
5
by: SAL | last post by:
Hello, I would like to be able to set the WHERE clause of a select statement on the fly. I have a DataAccess layer designed using the DataSet designer and a BusinessLogic layer using classes. The...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.