Bug #14412 | MySqlCommandBuilder does not automatically open connections for update | ||
---|---|---|---|
Submitted: | 27 Oct 2005 21:46 | Modified: | 6 Nov 2007 15:27 |
Reporter: | Don Lopez | Email Updates: | |
Status: | Duplicate | Impact on me: | |
Category: | Connector / NET | Severity: | S4 (Feature request) |
Version: | 1.0 | OS: | Windows (Windows 2000) |
Assigned to: | CPU Architecture: | Any |
[27 Oct 2005 21:46]
Don Lopez
[30 Oct 2005 11:08]
Vasily Kishkin
I am not sure that MySqlCommandBuilder must automatically open connection. Could you please write here where I can read about the topic ?
[31 Oct 2005 0:16]
Don Lopez
Vasily, It was my understanding that the MySQL.NET connector was intended to be fully compatible with existing ADO.NET objects. I ran into the problem when converting from the stock objects under System.Data to the MySQL provided Mysql.Data objects. Basically, using the System.Data objects provided in the .NET framework (in my case OLEDB objects), you can use the command builder to automatically generate update/delete/insert statements from a SELECT statement given when you create the data adapter. Afterwards, the data adapter behaves exactly like one that was created with manually entered update/delete/insert statements. Using the Mysql.Data objects, the data adapter behaves differently if you use the command builder to generate the update/delete/insert statements. Instead of just being able to run .Update on the data adapter, you have to manually run .Open() and then .Close(). However, if you specify the update/delete/insert statements manually, the MySQL.Data objects behave just like the System.Data objects. This seems to be a bug related to the command builder method of the MySQLDataAdapter. The command is built correctly, but the .Update() method requires that you manually open the connection first, which isn't typical. Again, not sure about a source for the documentation, but this can be repeated pretty easily if you have VS.NET handy. If this isn't a declared feature of the MySQL.NET connector, feel free to downgrade this to a feature request, not critical but makes migration slightly tedious in some cases.
[6 Nov 2007 15:27]
Reggie Burnett
This is a duplicate of 8131 which has been fixed.