【问题标题】:unable to update the oracle DB using ExecuteNonQuery()无法使用 ExecuteNonQuery() 更新 oracle 数据库
【发布时间】:2017-11-16 13:12:00
【问题描述】:

请在下面找到源代码。我没有收到任何错误,但
_oracleCommand.ExecuteNonQuery() 将无限运行 - 调试器不会移动到下一行。我可以使用 Toad 更新数据。我被这个困住了。

  public void UpdateNewResignationRequestInSynergy(string _employeeno, string _comment, string _changeby, string _changeddt, string _reason)
    {
        int rowsaffected = 0;
        string returnStatus;
        string _synquery = "";
        DateTime dtDate;
        _employeeno = "774647";
        _comment = "contract eand";
        dtDate = DateTime.Parse(_changeddt, System.Globalization.CultureInfo.CreateSpecificCulture("en-CA"));
        _oracleCommand = new OracleCommand(_synquery, _synergyDb);
        _synergyDb.Open();
        _oracleCommand.CommandText = string.Format(@"update wipinfo.fms_resignation set str_comments = 'contract end' where STR_CONTRACTOR_ID = 774647");
        _oracleCommand.CommandType = CommandType.Text;
        try
        {
             _oracleCommand.ExecuteNonQuery();



        }
        catch(Exception ex)
        {

        }
        _synergyDb.Close();

    }

【问题讨论】:

  • 试试_oracleCommand.ExecuteNonQuery();
  • 对不起,它是 _oracleCommand.ExecuteNonQuery();只有
  • 也许您的更新语句中记录了很多记录并且需要很长时间来处理?
  • @StevenLemmens 不只有一条记录

标签: c# oracle executescalar


【解决方案1】:

您必须停止 oracle 服务器并重新启动(不要重新启动它不会帮助您)。我通过这个过程解决了这个问题。

【讨论】:

    猜你喜欢
    • 2011-08-16
    • 1970-01-01
    • 1970-01-01
    • 2016-08-28
    • 1970-01-01
    • 2017-03-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多