Microsoft KB Archive/816802

= A &quot;No mapping exists from DbType Object to a known OdbcType&quot; error occurs when you configure the OdbcDataAdapter by using the Data Adapter Configuration Wizard =

Article ID: 816802

Article Last Modified on 3/10/2006

-

APPLIES TO


 * Microsoft Visual Studio .NET 2003 Enterprise Architect
 * Microsoft Visual Studio .NET 2003 Enterprise Developer
 * Microsoft Visual Studio .NET 2003 Academic Edition
 * Microsoft Visual Basic .NET 2003 Standard Edition
 * Microsoft Visual C# .NET 2003 Standard Edition
 * Microsoft ADO.NET 1.1

-



SYMPTOMS
When you configure the OdbcDataAdapter using the Data Adapter Configuration Wizard, you may receive the following error message after you specify the SQL query string:

No mapping exists from DbType Object to a known OdbcType.



CAUSE
The problem occurs because the query string that is specified in the SELECT command of the Data Adapter Configuration Wizard is incorrect. When the query string is incorrect, the Data Adapter Configuration Wizard incorrectly generates the error message that is specified in the &quot;Symptoms&quot; section instead of one of the following error messages:

Invalid column name.

-or-

Invalid table name.



RESOLUTION
To resolve this problem, specify a valid query string on the Generate the SQL statements page when you configure the OdbcDataAdapter using the Data Adapter Configuration Wizard.



STATUS
This behavior is by design.



Steps To Reproduce the Behavior
 In Visual Studio .NET, create a new Visual Basic .NET or Visual C# .NET Windows Application project. In the ToolBox, double-click OdbcDataAdapter. The Data Adapter Configuration Wizard starts. Click Next. In Which data connection should the data adapter use?, click the Northwind database of your SQL Server.

Note: If the connection does not exist, click New Connection to create a new connection. Click Next. Click the Use SQL statements option in the next page of the wizard, and then click Next.</li>  In the Generate the SQL statements page, type the following SQL statement: SELECT * FROM CUSTOMER WHERE CUSTOMERID = ? </li> Click Next. You receive the error message that is described in the &quot;Symptoms&quot; section of this article.</li></ol>

<div class="references_section">