Bug #58374 | TableAdapterManager.UpdateAll() Error | ||
---|---|---|---|
Submitted: | 22 Nov 2010 9:26 | Modified: | 10 Dec 2010 7:23 |
Reporter: | wang gang | Email Updates: | |
Status: | Duplicate | Impact on me: | |
Category: | Connector / NET | Severity: | S1 (Critical) |
Version: | 6.3.5 | OS: | Windows (windows7&server 2008) |
Assigned to: | CPU Architecture: | Any | |
Tags: | "Transaction has already been rolled back or is not pending", TableAdapterManager.UpdateAll() |
[22 Nov 2010 9:26]
wang gang
[22 Nov 2010 9:40]
Tonci Grgin
Hi Wang and thanks for your report. It would be best if you can attach a small but complete test case project along with DDL/DML for tables in question.
[23 Nov 2010 3:45]
wang gang
DDL CREATE TABLE `tmaster` ( `id` int(11) NOT NULL AUTO_INCREMENT, `mc` varchar(20) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 CREATE TABLE `tdetail` ( `id` int(11) NOT NULL AUTO_INCREMENT, `mc` varchar(20) DEFAULT NULL, `tmaster_id` int(11) DEFAULT NULL, PRIMARY KEY (`id`), KEY `fk_tmaster_id` (`tmaster_id`), CONSTRAINT `fk_tmaster_id` FOREIGN KEY (`tmaster_id`) REFERENCES `tmaster` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8
[23 Nov 2010 3:46]
wang gang
Form1.cs using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace testMDofMySql { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { this.tdetailTableAdapter.Fill(this.testaDataSet.tdetail); } private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { testaDataSet.tdetailRow r = (testaDataSet.tdetailRow)((DataRowView)tdetailBindingSource.Current).Row; int id = r.id; if (dataGridView1.Columns[e.ColumnIndex].Name == "delete") { tdetailBindingSource.RemoveCurrent(); } } private void btnSave_Click(object sender, EventArgs e) { try { this.tableAdapterManager1.UpdateAll(testaDataSet); } catch (Exception ex) { MessageBox.Show(ex.Message); } } } }
[26 Nov 2010 7:31]
Tonci Grgin
I am sorry Wang but these are bits and pieces of actual project you run... Can you please attach an entire solution that I can load into VS2008 and try. Include please relevant part of my.ini concerning InnoDB and SQL_MODE server is in.
[29 Nov 2010 4:06]
wang gang
OK. I downloaded the source file of the connector-net 6.3.5.Opened it's .sln file in visual studio 2010. I removed the lines between 188 to 195 in dataadapter.cs. Rebuild. Replace the old MySql.Data.dll with this rebuilded Mysql.Data.dll in my projects. Then,the errors disapeared.
[10 Dec 2010 7:21]
Valeriy Kravchuk
Bug #58853 was marked as a duplicate of this one.
[10 Dec 2010 7:23]
Tonci Grgin
Wang, your colleague in Bug#58853 described the problem better so I'll close this report and work on his.