liu_sir:
问题已经解决.必须用OleDbParameter,直接用CommandText = "proc(p1,p2)"好像不行,与msSql有点不同;
[阅读: 627] 2006-08-02 07:55:50
看看俺写的代码
public int ExecuteProc(string sProcName,OleDbParameter[] paras)
{
this.m_SelectCmd.CommandType = CommandType.StoredProcedure;
this.m_SelectCmd.CommandText = sProcName;
int affectCount = 0;
try
{
this.m_SelectCmd.Parameters.AddRange(paras);
affectCount = this.m_SelectCmd.ExecuteNonQuery();
this.m_SelectCmd.CommandType = CommandType.Text;
return affectCount;
}
catch (Exception)
{
this.m_SelectCmd.CommandType = CommandType.Text;
return -2;
}
}