none
How to assign ODP.NET's OracleDBType to DBParameter's DBType (using ADO.NET2.0's DBProviderFactory). RRS feed

  • Question

  • Hi,

     

    How to assign ODP.NET's OracleDBType to DBParameter's DBType (using ADO.NET2.0's DBProviderFactory, generic DAL).The following code throws an exception

     

    param.DbType = Oracle.DataAccess.Client.OracleDbType.Int32

     

    throws error as "Specified argument was out of the range of valid values."

     

    Sample Code

     

    Dim dbprovider As DbProviderFactory
    dbprovider = DbProviderFactories.GetFactory("Oracle.DataAccess.Client")
    Dim param As DbParameter = dbprovider.CreateParameter
    param.ParameterName = "PI_Id"
    param.DbType = Oracle.DataAccess.Client.OracleDbType.Int32

     

    error

    ex.Message = "Specified argument was out of the range of valid values."

     

     

    Thanks.

    Thursday, December 20, 2007 4:27 PM