Bug 12853 - Ado.net TableAdapter Update Method Fails Or Results In RowError
Summary: Ado.net TableAdapter Update Method Fails Or Results In RowError
Status: NEW
Alias: None
Product: Class Libraries
Classification: Mono
Component: System.Data (show other bugs)
Version: unspecified
Hardware: All All
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2013-06-24 13:55 UTC by jhpetersen
Modified: 2013-08-08 02:25 UTC (History)
3 users (show)

See Also:
Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Small Visual Studio 2012 Solution To Reproduce The Bugs (194.89 KB, application/octet-stream)
2013-06-24 13:55 UTC, jhpetersen
Details

Description jhpetersen 2013-06-24 13:55:08 UTC
Created attachment 4190 [details]
Small Visual Studio 2012 Solution To Reproduce The Bugs

There are two major issues with the Ado.net TableAdapter.Update() method:

1.) If one inserts or updates a DataRow and then the TableAdapter.Update(DataSet) method is called, the method fails with an exception that the column cannot be null. Debugging the generated SQL command shows that all parameters passed are NULL.

2.) If one inserts or updates a DataRow and then the TableAdapter.Update(DataTable) method is called, the update succeeds but a RowError for the inserted/updated row is set. Any following TableAdapter.Fill(DataTable) fails with a ConstraintException - even if another table is filled.

The two bugs don't occur with Microsoft .Net and are reproducible with latest stable Mono on Windows 7, Mac OSX 10.8 and Linux Debian Wheezy.

I attached a small Visual Studio 2012 Solution with two projects which show the bugs (one for a MSSQL Database and one for a MySQL Database using the latest stable MySQL.Net Connector).
To test the solution please extract the 7Zipped file and create the database(s) with the supplied SQL Dump file. (for MySQL you have to create the user by yourself..). Change the connection string according to your server name and user id/pass..
Have a look on the comments in the source code to get more information..

Note You need to log in before you can comment on or make changes to this bug.