[Mono-dev] Error converting Oracle Types - bug found?

APS dev.malst at apsystems.it
Mon Mar 19 10:50:30 EDT 2007


I've checked mono source (rev 72742) and I think to have found the problem:
The set_Value calls
InferOracleType
that makes


case "System.Int64":
         SetOracleType (OracleType.Number);
         break;


SetOracleType makes


case OracleType.Number:
         dbType = DbType.VarNumeric;


DbType property act in this way


public DbType DbType {
         get { return dbType; }
         set { SetDbType (value); }
}


but the function SetDbType does not provide a conversion for 
DbType.VarNumeric so


string exception = String.Format ("No mapping exists from DbType {0} 
to a known OracleType.", type);


is thrown.
Hope this helps.



At 13.23 19/03/2007, you wrote:
>Hi guys,
>I've found that if I create a parameter of an OracleCommand passing 
>a DataRow[index] object as value, if this object contains a number 
>the DbType properties assume VarNumeric value.
>The strange thing is that if I make something like
>
>myparam.DbType=myparam.DbType
>
>(reassingning it's own value) I obtain this error:
>
>
>
>System.ArgumentException: No mapping exists from DbType VarNumeric
>to a known OracleType.
>   at System.Data.OracleClient.OracleParameter.SetDbType (DbType
>type) [0x00000]
>   at System.Data.OracleClient.OracleParameter.set_DbType (DbType
>value) [0x00000]
>
>so I think there's some incongruence between the internal DbType 
>evaluation and the conversion made by the SetDbType.
>
>
>I'm wrong?
>
>
>
>
>
>
>_______________________________________________
>
>Mono-devel-list mailing list
>
>Mono-devel-list at lists.ximian.com
>
>http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20070319/3038aedb/attachment.html 


More information about the Mono-devel-list mailing list