public struct UpdataStruct
{
public string arg_Lsh;//流水号
public string SFZHM;//身份证
public string KSCX;//考试车型
public DateTime arg_Ksrq;//考试日期
public int arg_Kscj;// 考试成绩
public int arg_Kscs;// 考试次数
public string arg_Ksy1;// 考试员
public string arg_Ksy2;// 考试员
public string Zt;//考试状态
public string arg_Sn;// 序列号,与原接口序列号一致
public int arg_Res;// 返回结果
public string arg_Err;// 错误描述
}OracleParameter[] parameters ={ new OracleParameter("lsh",OracleType.VarChar,11),
new OracleParameter("sfzmhm",OracleType.VarChar,18),
new OracleParameter("kscx",OracleType.VarChar,2),
new OracleParameter("ksrq",OracleType.DateTime,8),
new OracleParameter("kscj",OracleType.Int16,3),
new OracleParameter("kscs",OracleType.Int16,2),
new OracleParameter("ksy1",OracleType.VarChar,30),
new OracleParameter("ksy2",OracleType.VarChar,30),
new OracleParameter("jbr",OracleType.VarChar,30),
new OracleParameter("zt",OracleType.VarChar,1),
new OracleParameter("sn",OracleType.VarChar,32),
new OracleParameter("res",OracleType.Int16,1),
new OracleParameter("err",OracleType.VarChar,50)};
parameters[0].Value = UpdataS.arg_Lsh;
parameters[1].Value = UpdataS.SFZHM;
parameters[2].Value = UpdataS.KSCX;
parameters[3].Value = UpdataS.arg_Ksrq;
parameters[4].Value = UpdataS.arg_Kscj;
parameters[5].Value = UpdataS.arg_Kscs;
parameters[6].Value = UpdataS.arg_Ksy1;
parameters[7].Value = UpdataS.arg_Ksy2;
parameters[8].Value = "王青博";
parameters[9].Value = UpdataS.Zt;
parameters[10].Value = UpdataS.arg_Sn; parameters[0].Direction = ParameterDirection.Input;
parameters[1].Direction = ParameterDirection.Input;
parameters[2].Direction = ParameterDirection.Input;
parameters[3].Direction = ParameterDirection.Input;
parameters[4].Direction = ParameterDirection.Input;
parameters[5].Direction = ParameterDirection.Input;
parameters[6].Direction = ParameterDirection.Input;
parameters[7].Direction = ParameterDirection.Input;
parameters[8].Direction = ParameterDirection.Input;
parameters[9].Direction = ParameterDirection.Input;
parameters[10].Direction = ParameterDirection.Input;
parameters[11].Direction = ParameterDirection.Output;
parameters[12].Direction = ParameterDirection.Output;
string slq = "DRV_ADMIN.DRV_INTERFACE.WRITE_KM2";
Oracle_DataBC.CreateQueryCommand(slq, parameters); public void CreateQueryCommand(string procName, OracleParameter[] prams)
{
OracleCommand cmd;
Open();
try
{
cmd = new OracleCommand(procName, orl_con);
cmd.CommandType = CommandType.StoredProcedure; foreach (OracleParameter parameter in prams)
{
cmd.Parameters.Add(parameter);
}
cmd.ExecuteNonQuery();
}
catch (Exception e)
{
throw (e);
}
finally
{
this.Close();
} }
错误信息
09051576086*370303199003043517*C1*2009-8-15 10:44:40*80*1*唐丽霞*武斌*1
System.Data.OracleClient.OracleException: ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'WRITE_KM2'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored at DataDao.DataBaseClass.CreateQueryCommand(String procName, OracleParameter[]& prams)
at DataDao.UpdateData.UpOracleData(UpdataStruct UpdataS, String& errorTxt)
{
public string arg_Lsh;//流水号
public string SFZHM;//身份证
public string KSCX;//考试车型
public DateTime arg_Ksrq;//考试日期
public int arg_Kscj;// 考试成绩
public int arg_Kscs;// 考试次数
public string arg_Ksy1;// 考试员
public string arg_Ksy2;// 考试员
public string Zt;//考试状态
public string arg_Sn;// 序列号,与原接口序列号一致
public int arg_Res;// 返回结果
public string arg_Err;// 错误描述
}OracleParameter[] parameters ={ new OracleParameter("lsh",OracleType.VarChar,11),
new OracleParameter("sfzmhm",OracleType.VarChar,18),
new OracleParameter("kscx",OracleType.VarChar,2),
new OracleParameter("ksrq",OracleType.DateTime,8),
new OracleParameter("kscj",OracleType.Int16,3),
new OracleParameter("kscs",OracleType.Int16,2),
new OracleParameter("ksy1",OracleType.VarChar,30),
new OracleParameter("ksy2",OracleType.VarChar,30),
new OracleParameter("jbr",OracleType.VarChar,30),
new OracleParameter("zt",OracleType.VarChar,1),
new OracleParameter("sn",OracleType.VarChar,32),
new OracleParameter("res",OracleType.Int16,1),
new OracleParameter("err",OracleType.VarChar,50)};
parameters[0].Value = UpdataS.arg_Lsh;
parameters[1].Value = UpdataS.SFZHM;
parameters[2].Value = UpdataS.KSCX;
parameters[3].Value = UpdataS.arg_Ksrq;
parameters[4].Value = UpdataS.arg_Kscj;
parameters[5].Value = UpdataS.arg_Kscs;
parameters[6].Value = UpdataS.arg_Ksy1;
parameters[7].Value = UpdataS.arg_Ksy2;
parameters[8].Value = "王青博";
parameters[9].Value = UpdataS.Zt;
parameters[10].Value = UpdataS.arg_Sn; parameters[0].Direction = ParameterDirection.Input;
parameters[1].Direction = ParameterDirection.Input;
parameters[2].Direction = ParameterDirection.Input;
parameters[3].Direction = ParameterDirection.Input;
parameters[4].Direction = ParameterDirection.Input;
parameters[5].Direction = ParameterDirection.Input;
parameters[6].Direction = ParameterDirection.Input;
parameters[7].Direction = ParameterDirection.Input;
parameters[8].Direction = ParameterDirection.Input;
parameters[9].Direction = ParameterDirection.Input;
parameters[10].Direction = ParameterDirection.Input;
parameters[11].Direction = ParameterDirection.Output;
parameters[12].Direction = ParameterDirection.Output;
string slq = "DRV_ADMIN.DRV_INTERFACE.WRITE_KM2";
Oracle_DataBC.CreateQueryCommand(slq, parameters); public void CreateQueryCommand(string procName, OracleParameter[] prams)
{
OracleCommand cmd;
Open();
try
{
cmd = new OracleCommand(procName, orl_con);
cmd.CommandType = CommandType.StoredProcedure; foreach (OracleParameter parameter in prams)
{
cmd.Parameters.Add(parameter);
}
cmd.ExecuteNonQuery();
}
catch (Exception e)
{
throw (e);
}
finally
{
this.Close();
} }
错误信息
09051576086*370303199003043517*C1*2009-8-15 10:44:40*80*1*唐丽霞*武斌*1
System.Data.OracleClient.OracleException: ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'WRITE_KM2'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored at DataDao.DataBaseClass.CreateQueryCommand(String procName, OracleParameter[]& prams)
at DataDao.UpdateData.UpOracleData(UpdataStruct UpdataS, String& errorTxt)
解决方案 »
- 分享+讨论:c#中类的序列化:一般化解决方法及最后的疑问
- 请问第三方组件dotnetbar 里面的DataGridViewX 是怎样设置选中行的背景色?
- 成绩管理系统的布局(帮帮忙)
- 在C语言中定义的" HANDLE " 变量函数 如何把这个函数转换成C#的啊 ??? C#中好象没有handle 类型的定义啊??
- GUID 构造函数 异常 太奇怪了!!
- .net页面中有一个子frame,请问怎么用当子frame在运行过程中捕捉到异常后,怎么调用主窗体转到错误页面去,?我记得javascript能实现这个,那个说一下??
- 用过掌上电脑的请进入
- C#将ComboBox放入ToolBox中?
- 方法就一定是函数,属性就一定是一个变量存储的值吗?有什么区别呀
- 几个小问题?
- 关于xml的问题...
- 关于C#中的线程
看看这个存储过程都需要些什么名称和类型的参数。
。这一块,,,再跟数据库的表的字段对比一下
09051576086 * 370303199003043517 * C1 * 09年8月15日10时44分40秒* 80 * 1 *唐丽霞*武斌* 1 System.Data.OracleClient.OracleException:欧劳- 06550:第1行,第7列: 偏最小二乘- 00306:错号码或在调用的参数类型'WRITE_KM2' Ora- 06550:第1行,第7列: PL / SQL程序:语句被忽略
)
lsh 流水号\ sfzmhm 身份证\kscx 考试车型\ksrq 考试日期\kscj 考试成绩\kscs考试次数\ksy1监考员1\ksy2 监考员2\jbr 经办人\zt 考试结果 \sn 考试认证码 \res 返回值 \err错误描述
lsh 流水号\ sfzmhm 身份证\kscx 考试车型\ksrq 考试日期\kscj 考试成绩\kscs考试次数\ksy1监考员1\ksy2 监考员2\jbr 经办人\zt 考试结果 \sn 考试认证码 \res 返回值 \err错误描述