data type mapping error

  • Thread starter Thread starter VBM
  • Start date Start date
V

VBM

I am writing generic database coponent which will connect to sybase, SQL
Server , oracle etc ...I am using IDBDataParameter , my store proc requires
integer paramter

say

IDbDataParameter parameterTabOrder =
myGenComponent.CreateDataParameter("@PageOrder", System.Data.DbType.UInt16,
4);
parameterTabOrder.Direction = ParameterDirection.Output;
myCommand.Parameters.Add(parameterTabOrder);

IDataReader result = myCommand.ExecuteReader();

For SQL Server when this is run it gives me error as "No mapping exists
from DbType UInt16 to a known SqlDbType."
The same code works good for Sybase. I tried Int16, Int32, that also
fails....I want something generic which will fit for different databases....

any clues
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top