The Auto-Generated Code of TableAdapterManager class in VS2008 and VS2010 are different - by CSSForumEngineer

Status : 

  Fixed<br /><br />
		This item has been fixed in the current or upcoming version of this product.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 583180 Comments
Status Closed Workarounds
Type Bug Repros 6
Opened 8/4/2010 2:51:49 AM
Access Restriction Public


The Auto-Generated Code of TableAdapterManager class in VS2008 and VS2010 are different. In vs2008, the UpdateInsertedRows method of TableAdapterManager is correct.
The parent TableAdapter's update method is called before the childTableAdapter's update method. So we can insert a new row to the parent table and a new row to the child table(with a primary key in parent table) correctly. However, in vs2010, the order is kind of reversed. We will get a exception saying that "The INSERT statement conflicted with the FOREIGN KEY constraint ..." when calling tableAdapterManager.UpdateAll method. With the same settings, the behaviours in vs 2008 and vs2010 are different.

You can refer to this thread for some details.
Sign in to post a comment.
Posted by Microsoft on 4/29/2014 at 12:18 PM
Thank you for reporting this issue. This issue has been fixed in Visual Studio 2013. You can install a trial version of Visual Studio 2013 with the fix from:
Posted by dobos.sandor on 1/25/2011 at 7:51 AM

Is this bug fixed in SP1 beta?
Is any hotfix available?
Posted by Microsoft on 9/6/2010 at 11:47 PM
Hi Hans,

I can fully understand your complaints. However we are unable to fix this bug in VS2010 RTM because it has already been shipped. We are sorry that we didn't find this regression bug before the release, and trying to get this fix in SP1. Before that, if the issue is blocking you from using the product, please contact our support via the Visual Studio Help and Support page on MSDN.

Posted by Hans-Peter H on 9/1/2010 at 12:50 AM
In the documentation "TableAdapterManager" is described as the component that cares for Hierarchical Update. This feature was introduced in VS2008 und it is not working any longer in VS2010. And Microsoft says it won't be fixed in this version.
My conclusion: Microsoft is saying (in bold): Don't use DataSet any longer!!!
Posted by Microsoft on 8/31/2010 at 8:07 PM

Thanks for filing the bug. Because VS2010 has been shipped, we are fixing this one for future release.

Unfortuantely, you cannot directly use VS2008 custom tool in VS2010 as a workaround. The only way we are aware to work around this issue now is to update the tableAdapter orders in TableAdapterManager.UpdateInsertedRows, TableAdapterManager.UpdateUpdatedRows and TableAdapterManager.UpdateDeletedRows of the generated DataSet Designer code. And you will need to do this as long as DataSet Designer generates code.

If you have any concerns, questions or comments, please feel free to let me know.

Xiaoying Guo
Program Manager, Visual Studio Business Applications Tooling
Posted by Hans-Peter on 8/31/2010 at 5:47 AM
This issue is solved? So - please tell me what to do? Is there a workaround? Do I have to wait for the next visual studio release and use vs2008 till then?
Posted by Pierre-Alain Vigeant on 8/23/2010 at 8:31 AM
Any possible workaround? Can we ask Visual Studio 2010 to use the Visual Studio 2008 custom tool?
Posted by Microsoft on 8/4/2010 at 4:03 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(