public string AddProductVolume(string[] psids, int[] integral, DateTime[] sdate, DateTime[] edate, DefPanIntegralSet obj)
        {
            string message = "";
            string connectionstring = ConfigurationManager.ConnectionStrings["Connection String"].ToString();
            OracleConnection con = new OracleConnection(connectionstring);
            int i = 0;
            try
            {
                con.Open();
                OracleCommand cmd = con.CreateCommand();
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.CommandText = "ProAddProductVolume.AddProductVolume";
                OracleParameter param1 = new OracleParameter(@"CID", OracleDbType.Char, 4);
                param1.Direction = ParameterDirection.Input;
                param1.CollectionType = OracleCollectionType.None;
                param1.Value = obj.CID;
                cmd.Parameters.Add(param1);                OracleParameter param2 = new OracleParameter(@"PSID", OracleDbType.Varchar2, 4);
                param2.Direction = ParameterDirection.Input;
                param2.CollectionType = OracleCollectionType.PLSQLAssociativeArray;
                param2.Value = psids;
                cmd.Parameters.Add(param2);                OracleParameter param3 = new OracleParameter(@"INTEGRAL", OracleDbType.Int32, integral.Length);
                param3.Direction = ParameterDirection.Input;
                param3.CollectionType = OracleCollectionType.PLSQLAssociativeArray;
                param3.Value = integral;
                cmd.Parameters.Add(param3);                OracleParameter param4 = new OracleParameter(@"INTEGRALSTARTDATE", OracleDbType.Date, sdate.Length);
                param4.Direction = ParameterDirection.Input;
                param4.CollectionType = OracleCollectionType.PLSQLAssociativeArray;
                param4.Value = sdate;
                cmd.Parameters.Add(param4);                OracleParameter param5 = new OracleParameter(@"INTEGRALENDDATE", OracleDbType.Date, edate.Length);
                param5.Direction = ParameterDirection.Input;
                param5.CollectionType = OracleCollectionType.PLSQLAssociativeArray;
                param5.Value = edate;
                cmd.Parameters.Add(param5);                OracleParameter param6 = new OracleParameter(@"p_ret", OracleDbType.Int32,1);
                param6.Direction = ParameterDirection.Output;
                param6.CollectionType = OracleCollectionType.None;
                cmd.Parameters.Add(param6);                cmd.ExecuteNonQuery();
                i = Convert.ToInt32(cmd.Parameters[5].Value.ToString().Trim());
            }
create or replace package body ProAddProductVolume
is
PROCEDURE AddProductVolume
(
 CID in varchar2,--活动企业ID
 PSID in string_array,--产品编号
 INTEGRAL in integral_array,--产品积分
 INTEGRALSTARTDATE in sdate_array,--开始日期
 INTEGRALENDDATE in edate_array,--结束日期
 p_ret  out int_array --返回的结果集
)
as
 intcount number(1);
 begin
     for p IN PSID.first..PSID.last loop
       begin
        select count(*)into intcount from pan_integralset where PSID =PSID(p) and CID = CID; 
       if intcount =1   then
            update pan_integralset set INTEGRAL =INTEGRAL(p),INTEGRALSTARTDATE=to_date(INTEGRALSTARTDATE(p),'YYYY-MM-DD'),
            INTEGRALENDDATE=to_date(integralenddate(p),'YYYY-MM-DD');
            p_ret(p):=1;
            commit;
       else 
        insert into  pan_integralset
                     (CID,PSID,INTEGRAL,INTEGRALSTARTDATE,INTEGRALENDDATE)
              values(CID,PSID(p),INTEGRAL(p),to_date(INTEGRALSTARTDATE(p),'YYYY-MM-DD'),to_date(INTEGRALENDDATE(p),'YYYY-MM-DD'));      
           p_ret(p) := 2;   
       end if;
       
       exception
         when others then
             p_ret(p) :=0;
             rollback;
      end; 
     end loop;
     commit;
 end AddProductVolume;
end ProAddProductVolume;
上面是ado 下面的是存储过程
 老是抱这个错误 希望大家帮帮我~

解决方案 »

  1.   

    PLS-00306 wrong number or types of arguments in call to 'string'Cause: This error occurs when the named subprogram call cannot be matched to any declaration for that subprogram name. The subprogram name might be misspelled, a parameter might have the wrong datatype, the declaration might be faulty, or the declaration might be placed incorrectly in the block structure. For example, this error occurs if the built-in square root function SQRT is called with a misspelled name or with a parameter of the wrong datatype.Action: Check the spelling and declaration of the subprogram name. Also confirm that its call is correct, its parameters are of the right datatype, and, if it is not a built-in function, that its declaration is placed correctly in the block structure.
      

  2.   

    CID in varchar2,--活动企业ID
    这个字段用这个模型传过去的 DefPanIntegralSet obj
      

  3.   

    OracleParameter param1 = new OracleParameter(@"CID", OracleDbType.Char, 4); 

    PROCEDURE AddProductVolume
    (
     CID in varchar2,--活动企业ID标红的部分不一致