Page 1 of 1

Error: Inconvertable Type Mismatch

Posted: Wed 12 Feb 2014 20:45
by marks
I'm getting a strange error when trying to load data from a sqlite table:

Inconvertible type mismatch between SourceColumn 'container_quantity' of String and the DataColumn 'container_quantity' of Byte[].

The column type is string and I'm not using any Byte[]. It only seems to happen if I pass an empty string ("") as a parameter to my sql statement. If I pass a space (" ") it works. I'm using the latest version downloaded today, running on Windows 8.1 64bit.

Code: Select all

   at System.Data.Common.DataColumnMapping.GetDataColumnBySchemaAction(String sourceColumn, String dataSetColumn, DataTable dataTable, Type dataType, MissingSchemaAction schemaAction)
   at System.Data.ProviderBase.SchemaMapping.SetupSchemaWithoutKeyInfo(MissingMappingAction mappingAction, MissingSchemaAction schemaAction, Boolean gettingData, DataColumn parentChapterColumn, Object chapterValue)
   at System.Data.ProviderBase.SchemaMapping..ctor(DataAdapter adapter, DataSet dataset, DataTable datatable, DataReaderContainer dataReader, Boolean keyInfo, SchemaType schemaType, String sourceTableName, Boolean gettingData, DataColumn parentChapterColumn, Object parentChapterValue)
   at System.Data.Common.DataAdapter.FillMappingInternal(DataSet dataset, DataTable datatable, String srcTable, DataReaderContainer dataReader, Int32 schemaCount, DataColumn parentChapterColumn, Object parentChapterValue)
   at System.Data.Common.DataAdapter.FillMapping(DataSet dataset, DataTable datatable, String srcTable, DataReaderContainer dataReader, Int32 schemaCount, DataColumn parentChapterColumn, Object parentChapterValue)
   at System.Data.Common.DataAdapter.FillFromReader(DataSet dataset, DataTable datatable, String srcTable, DataReaderContainer dataReader, Int32 startRecord, Int32 maxRecords, DataColumn parentChapterColumn, Object parentChapterValue)
   at System.Data.Common.DataAdapter.Fill(DataSet dataSet, String srcTable, IDataReader dataReader, Int32 startRecord, Int32 maxRecords)
   at Devart.Data.SQLite.SQLiteDataAdapter.a(DataTable A_0, SQLiteDataReader A_1, DataSet A_2, String A_3, Int32 A_4, Int32 A_5)
   at Devart.Data.SQLite.SQLiteDataAdapter.a(DataSet A_0, String A_1, IDataReader A_2, Int32 A_3, Int32 A_4)
   at Devart.Data.SQLite.SQLiteDataAdapter.Fill(DataSet dataSet, String srcTable, IDataReader dataReader, Int32 startRecord, Int32 maxRecords)
   at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
   at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
   at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
   at InspectionClient.Db.LocalDb.GetDataTable(String sql, Object[] parms) in c:\work\oss\inspectNet\InspectionClient\Db\LocalDb.cs:line 334
  
[/size]

Re: Error: Inconvertable Type Mismatch

Posted: Wed 12 Feb 2014 23:15
by marks
Now it looks like it is happening regardless of what I pass as a parameter to the query.

Re: Error: Inconvertable Type Mismatch

Posted: Thu 13 Feb 2014 14:46
by MariiaI
Please send us a small test project with the corresponding DDL/DML scripts (or send us a test SQLite database), so that we are able to determine the reason of this issue and investigate it in more details.

Re: Error: Inconvertable Type Mismatch

Posted: Thu 13 Feb 2014 15:09
by marks
I'll see if I can reproduce it in a small app I can send to you, but not sure if I will be able to do that.

I found a workaround. I changed the sqlite select statement to specifically cast the field that was causing the error as TEXT like this:
cast(ci.container_quantity as text) as container_quantity

The sqlite DDL for that field looks like this:
container_quantity varchar(25) NOT NULL default "",

That sqlite table DDL is derived from a server based MySql table, which is why it is defined as varchar instead of 'text'.

Re: Error: Inconvertable Type Mismatch

Posted: Fri 14 Feb 2014 10:05
by MariiaI
Thank you for the additional information. However, it is not enough for reproducing the issue. Thus, please create and send us a small test project with the corresponding DDL/DML scripts (or send us a test SQLite database), so that we are able to investigate this issue in more details.