c#中的ExecuteNonQuery命令出错

时间:2018-04-13 05:27:31

标签: c# sql oracle

public int Update_XYZ_tblData_Take_Processlog(int IID, string FileName, int PageCount, long FileSize, int CabID, int NUMBER, string monDate, int FileType, string  p_NUMBER, string FILE_NAME, string ACTIVITY, string Cab_Name, int p_IID, int DocId, int PAGES, int p_FILESIZE, string UPLOADEDMODE, DateTime DATETIME, long DFLAG,int DocumentID,int a3count)
{
    try
    {
        int id = 0;
        OracleConnection conn = new OracleConnection(objappSettings.ConnCEBD);
        if (conn.State == ConnectionState.Open)
        {
            conn.Close();
        }
        conn.Open();
        OracleCommand cmd = new OracleCommand("Update_XYZ_tblData_Take_Processlog", conn);
        cmd.CommandType = CommandType.StoredProcedure;
        cmd.Parameters.Add("IID", OracleDbType.Int32).Value = IID;
        cmd.Parameters.Add("DocumentName", OracleDbType.Varchar2).Value =FileName;
        cmd.Parameters.Add("Pages", OracleDbType.Int32).Value = PageCount;
        cmd.Parameters.Add("FileSize", OracleDbType.Int64).Value = FileSize;
        cmd.Parameters.Add("CabinetID", OracleDbType.Int32).Value = CabID;
        cmd.Parameters.Add("hhno", OracleDbType.Int32).Value = NUMBER;
        cmd.Parameters.Add("ONG_DOCUPLOADFLAG", OracleDbType.Varchar2).Value = monDate;
        cmd.Parameters.Add("Filetype", OracleDbType.Int32).Value = FileType ;
        cmd.Parameters.Add("NUMBER", OracleDbType.Varchar2).Value = p_NUMBER;
        cmd.Parameters.Add("FILE_NAME", OracleDbType.Varchar2).Value = FILE_NAME;
        cmd.Parameters.Add("Activity", OracleDbType.Varchar2).Value = ACTIVITY;
        cmd.Parameters.Add("Cab_Name", OracleDbType.Varchar2).Value = Cab_Name;
        cmd.Parameters.Add("IID", OracleDbType.Int32).Value = p_IID;
        cmd.Parameters.Add("DocId", OracleDbType.Int32).Value = DocId;
        cmd.Parameters.Add("PAGES", OracleDbType.Int32).Value = PAGES;
        cmd.Parameters.Add("FileSize", OracleDbType.Int64).Value = p_FILESIZE;
        cmd.Parameters.Add("UPLOADEDMODE", OracleDbType.Varchar2).Value = UPLOADEDMODE;
        cmd.Parameters.Add("DATETIME", OracleDbType.Date).Value = DATETIME;
        cmd.Parameters.Add("DFLAG", OracleDbType.Int64).Value = DFLAG;
        cmd.Parameters.Add("DOCUMENTID", OracleDbType.Int32).Value = DocumentID;
        cmd.Parameters.Add("a3count", OracleDbType.Int32).Value = a3count;
        cmd.ExecuteNonQuery();    //======= Error is here ============

        clsUtil.WriteOngMindsTransferLog("Updated Record to DocFsa_Exceldata_OngQC_Processlog..");

        conn.Close();
        return id;

    }
    catch (Exception ex)
    {
        return 0;
    }
}

cmd.ExecuteNonQuery()执行它将花费无限时间,为了执行此行,我必须重新启动计算机,这是什么解决方案? 我正在使用:

  1. Visual Studio 2008
  2. 操作系统:Windows Server 2008 R2
  3. 框架:3.5

1 个答案:

答案 0 :(得分:0)

我不知道如何执行"保存点a;"关于Oracle sqlworksheet问题已解决