代码:public int InsertDBBySend(string branchId,string operatorA,out string fileName)
        {
            int result = -1;
            OdbcParameter[] pars = new OdbcParameter[] { new OdbcParameter("@branch_id",OdbcType.VarChar,11), 
                                                         new OdbcParameter("@operator", OdbcType.VarChar,10),
                                                         new OdbcParameter("@error_msg",OdbcType.VarChar,100),
                                                         new OdbcParameter("@file_name",OdbcType.VarChar,60),
                                                         new OdbcParameter("@return",SqlDbType.Int)
                                                        };
           
            
            pars[0].Value = "SMBC";//branchId
            pars[1].Value = "SYS";//operatorA
            pars[2].Direction = ParameterDirection.Output;
            pars[3].Direction = ParameterDirection.Output;
           // pars[4].Value = -1;
            pars[4].Direction = ParameterDirection.ReturnValue;
            ArrayList list = new ArrayList();
            result = Convert.ToInt32(dbHelp.ExecuteQueryForScalar("sp_CMSCPGGenMsg", pars,out list));

 public object ExecuteQueryForScalar(string strSql, OdbcParameter[] parameters, out ArrayList parasList)
        {
            object result = -1;
            try
            {
                
                OdbcCommand sqlCmd = PrepareCommand(CommandType.StoredProcedure, strSql, parameters);
                parasList = new ArrayList();                sqlCmd.ExecuteNonQuery();
                result =sqlCmd.Parameters["@return"].Value;
                for (int i = 0; i < sqlCmd.Parameters.Count; i++)
                {
                    if (sqlCmd.Parameters[i].Direction == ParameterDirection.Output || sqlCmd.Parameters[i].Direction == ParameterDirection.InputOutput)
                        parasList.Add(sqlCmd.Parameters[i].Value);
                }
            }
            catch (Exception ex)
            {
                conn.Close();
                throw ex;
            }
            finally
            {
                //不能关闭数据库
            }
            return result;
        }protected OdbcCommand PrepareCommand(CommandType cmdType, string cmdText, params OdbcParameter[] cmdParms)
        {            //数据库连接对象              
            if (conn == null)          
                conn = new OdbcConnection(conn_string); 
            
            try     
            {                                    
                OdbcCommand cmd;
                
                //数据库连接状态
                if (conn.State != ConnectionState.Open)
                    conn.Open();
                //命令初始话
                
                cmd = conn.CreateCommand();
                //cmd.Connection = conn;
                cmd.CommandText = "exec  " + cmdText + "  "+getDuoGeWenHao(cmdParms.Length);
                //是否起事物
                if (trans != null)
                    cmd.Transaction = trans;
                //命令类型
                
                cmd.CommandType = cmdType;
                //传入命令参数
                if (cmdParms != null)
                {
                    foreach (OdbcParameter parm in cmdParms)
                    {
                        cmd.Parameters.Add(parm);
                    }
                }
                return cmd;
            }
            catch (Exception ex)
            {
                conn.Close();
            }
            return null;        }报ERROR [HY000] [INTERSOLV][ODBC SQL Server driver][SQL Server]ct_describe(): user api layer: external error: An illegal value of 3 given for parameter item.
错误,我急死了,调了一天,还是没解决!
请高手指点