Results 1 to 3 of 3

Thread: *SOLVED* Oracle Data types and C#.NET

  1. #1

    Thread Starter
    Addicted Member DJ_Catboy's Avatar
    Join Date
    Jan 2003
    Location
    Suffolk, UK
    Posts
    159

    *SOLVED* Oracle Data types and C#.NET

    Hi,

    Does anybody know what the equivalent data type in C# is for an oracle NUMBER value? I have tried all that I can think and I keep getting an ORA-06650 error (wrong number or types of arguments in call to 'IFSAPP.SALES_PART_API.GET_LIST_PRICE').

    Code:
    odc = new OleDbCommand();
    odc.CommandText = "ifsapp.sales_part_api.get_list_price('" + sContract + "','" + sPartNo + "' )";
    odc.CommandType = CommandType.StoredProcedure;
    odc.Connection = odbIFS;
    				
    prm = new OleDbParameter("rv",OleDbType.Integer,25);
    prm.Direction = ParameterDirection.ReturnValue;
    odc.Parameters.Add(prm);
    				
    prm = new OleDbParameter("contract_",OleDbType.VarChar,5);
    prm.Direction = ParameterDirection.Input;
    prm.Value = sContract;
    odc.Parameters.Add(prm);
    				
    prm = new OleDbParameter("part_no_",OleDbType.VarChar,25);
    prm.Direction = ParameterDirection.Input;
    prm.Value = sPartNo;
    odc.Parameters.Add(prm);
    				
    odc.ExecuteNonQuery();
    Hope somebody can help!?
    Thanks,
    DJ
    Last edited by DJ_Catboy; May 7th, 2004 at 09:42 AM.

  2. #2
    Addicted Member
    Join Date
    Jun 2003
    Location
    Birmingham, AL
    Posts
    188
    If the procedure requires NUMBER parameters you do not need the single quotes.

    Also isn't there a Oracle data provider; why are using oledb???

  3. #3

    Thread Starter
    Addicted Member DJ_Catboy's Avatar
    Join Date
    Jan 2003
    Location
    Suffolk, UK
    Posts
    159
    The Oracle library is only available in the 1.1 framework - I am still using 1.0..... however after looking at my code posted below I have found my problem! I have put the parameters in the command text which I should not have done!

    Code:
    odc.CommandText = "ifsapp.sales_part_api.get_list_price('" + sContract + "','" + sPartNo + "' )";
    should be...

    Code:
    odc.CommandText = "ifsapp.sales_part_api.get_list_price";
    Thanks for the help.,
    DJ

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width