0

Please find the source code below. I am not getting any error but
_oracleCommand.ExecuteNonQuery() is going infinite - debugger is not moving to next line. I am able to update the data using Toad. I am stuck with this.

  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();

    }
piet.t
  • 11,718
  • 21
  • 43
  • 52
Hardy
  • 629
  • 3
  • 8
  • 20
  • Try `_oracleCommand.ExecuteNonQuery();` – Wernfried Domscheit Jun 14 '17 at 11:44
  • sorry it was _oracleCommand.ExecuteNonQuery(); only – Hardy Jun 14 '17 at 11:46
  • Maybe your update statements hits a LOT of records and it takes a lot of time to process? – Steven Lemmens Jun 14 '17 at 11:54
  • @StevenLemmens no only one record – Hardy Jun 14 '17 at 11:55
  • @mjwills that was a typo error, i am using ExecuteNonQuery() _employeeno ,_comment these parameters I will be using .as simple update query is not working can't add these parameters now. – Hardy Jun 14 '17 at 13:06
  • Is _synergyDb some sort of global that stores the connection object? You use it, but I don't see you initializing it. –  Jun 14 '17 at 13:13
  • @mjwills if same query executed in Oracle client will 1 record with no time. no prob with query – Hardy Jun 14 '17 at 13:27
  • Does https://stackoverflow.com/a/5380747/34092 or https://stackoverflow.com/a/23696049/34092 help? – mjwills Jun 14 '17 at 13:31
  • Possible duplicate of [oracle ExecuteNonQuery freezes on ASP.Net](https://stackoverflow.com/questions/23687552/oracle-executenonquery-freezes-on-asp-net) – mjwills Jun 14 '17 at 13:33
  • @mjwills thanks a lot.... this works i have not committed in my oracle developer. https://stackoverflow.com/questions/23687552/oracle-executenonquery-freezes-on-asp-net/23696049#23696049 – Hardy Jun 14 '17 at 13:46

1 Answers1

0

You have to stop the oracle server and start again( do not restart it will not help you). I solved this problem by doing this process.

AB BA
  • 11