PRB - 'No mapping exists from DbType Object to a known OdbcType' error when using ODBC data provider
Sunday, 23 November 2008
When you are using smartDBforms.NET with ODBC data provider and some of the table
columns are of either binary or guid type you could receive the following
error when updating or inserting: 'No mapping exists from DbType Object to a known
OdbcType'
SYMPTOMS
When you are using smartDBforms.NET with ODBC data provider and some of the table
columns are of either binary or guid type you could receive the following
error when updating or inserting: 'No mapping exists from DbType Object to a known
OdbcType'
CAUSE
The binary and guid table columns are configured with parameters of type 'Object'
in the SmartDataSource parameters collection. The cause of the problem is that the
OdbcParameter.DbType property does not support DbType.Object value.
RESOLUTION
The problem
has been fixed in smartDBforms.NET 2.2 and later. SmartDataSource
sets the OdbcParameter.DbType property directly to either DbType.Binary or DbType.Guid.
WORKAROUND
You can fix the problem by changing the type from 'Object' to 'Empty'.
- Open SmartDataSource configuration wizard
- In the Select, Update, Insert and Delete tab do the following
- Click 'Show advanced properties' in order to show all properties of the parameters
- Click on each parameter and if its type is Object, then change the type to Empty.
- In this way the OdbcParameter.DbType property will not be set all.
APPLIES TO
- smartDBforms.NET 2.1 and previous versions when used with ODBC
data provider
|