[Migrated content. Thread originally posted on 10 August 2004]
Reading data via AcuODBC from the ADO.NET ODBC data provider works fine, and acucorp has a VB.NET example of this in their downloads area.However, there are problems when trying to implement more advanced features of the OdbcDataAdapter to allow dataset/datatable updates to persist back to the AcuODBC datasource. For instance in Visual Studio.NET 2003, when you drop an OdbcDataAdapter component onto your form, a handy wizard appears allowing you to specify your connection object, and to specify your select query, which in turn will generate four command objects for you: select, insert, update, and delete command objects. This is very helpful. The problem is that the wizard seems to be unable to retrieve the schema from the AcuODBC driver correctly and the paramater collections for the command objects cannot be created, which appears to stop the insert, update and delete command objects from rendering. The wizard actually informs you of this with warning icons at the end.
I'm thinking it may have to do with being unable to determine the primary key, but I'm not certain. I've triend workarounds like explictly setting the primary key column in the datatable, creating my own paramater collections, and using a CommandBuilder object, etc, but to no avail. I still get a system exception whenever I run the Update method of my OdbcDataAdapter object. The stack trace indicates a null reference for either the DataMappingTable or the DataRows array, but they appear to exist, so I'm lost.
Also, when you use the Server Explorer in VS.NET 2003, and open a connection to your AcuODBC data source and try to drill down into the field list for a table, VS.NET crashes. Yikes! This does not happen for an ODBC Access database or ODBC MS SQL database.
Another curious thing is that when I use an OdbcDataReader to read data from my AcuODBC datasource and then use the GetSchemaTable method, I get the schema just fine. So, the VS.NET wizard and the underlying .NEt framework Data classes must be having issues beyond just the schema, and that's why I mention perhaps the primary key issue.
Can anyone confirm these findings? Have you found a workaround? I've tried this with both AcuODBC 6.1 and 6.2 beta read/write versions. Any and all thoughts are welcome. In the meantime, my workaround is to simply use plain text SQL queries for all my selects, inserts, updates, and deletes, which is unfortunately not taking full advantage of what the DataAdapter can really do with dataset/datatable persistence.



