Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Oracle.DataAccess.Client.OracleCommand.ExecuteNonQuery() interrupts execution of the whole program [modified]

Oracle.DataAccess.Client.OracleCommand.ExecuteNonQuery() interrupts execution of the whole program [modified]

Scheduled Pinned Locked Moved Database
helpdatabaseoracletutorialquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    NandoMan
    wrote on last edited by
    #1

    Hello people of CP, I have a problem and would like you to help me fix it. The problem is that right after I call a stored procedure calling the method stated in the title, the execution of the program is interrupted without any warning or prompt whatsoever. The code block is this:

    public virtual object Execute()
    { return this.command.ExecuteNonQuery();
    }

    I know the command executes because the state in the DataBase is changed. But right after the return this.command.ExecuteNonQuery(); line, the program just stops. It doesn't throw an exception, it doesn't even go to the last bracket of the method, the program just exits. So, any idea what this might be? Thanks a lot! Edit: Here's a clearer example:

    private void SetSystemEnviroment()
    {
    try
    {
    using (OracleCommand command = this.con.CreateCommand())
    {
    command.CommandText = "SetSystemEnviroment";
    command.CommandType = CommandType.StoredProcedure;

                    command.ExecuteNonQuery();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                return;
            }
        }
    

    Again, after the command.ExecuteNonQuery(); line, it just stops the execution of the program, no warnings, no exceptions, nothing.

    modified on Monday, July 25, 2011 6:23 PM

    L H 2 Replies Last reply
    0
    • N NandoMan

      Hello people of CP, I have a problem and would like you to help me fix it. The problem is that right after I call a stored procedure calling the method stated in the title, the execution of the program is interrupted without any warning or prompt whatsoever. The code block is this:

      public virtual object Execute()
      { return this.command.ExecuteNonQuery();
      }

      I know the command executes because the state in the DataBase is changed. But right after the return this.command.ExecuteNonQuery(); line, the program just stops. It doesn't throw an exception, it doesn't even go to the last bracket of the method, the program just exits. So, any idea what this might be? Thanks a lot! Edit: Here's a clearer example:

      private void SetSystemEnviroment()
      {
      try
      {
      using (OracleCommand command = this.con.CreateCommand())
      {
      command.CommandText = "SetSystemEnviroment";
      command.CommandType = CommandType.StoredProcedure;

                      command.ExecuteNonQuery();
                  }
              }
              catch (Exception ex)
              {
                  MessageBox.Show(ex.Message);
                  return;
              }
          }
      

      Again, after the command.ExecuteNonQuery(); line, it just stops the execution of the program, no warnings, no exceptions, nothing.

      modified on Monday, July 25, 2011 6:23 PM

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Can you post the SetSystemEnviroment Stored Procedure code?

      1 Reply Last reply
      0
      • N NandoMan

        Hello people of CP, I have a problem and would like you to help me fix it. The problem is that right after I call a stored procedure calling the method stated in the title, the execution of the program is interrupted without any warning or prompt whatsoever. The code block is this:

        public virtual object Execute()
        { return this.command.ExecuteNonQuery();
        }

        I know the command executes because the state in the DataBase is changed. But right after the return this.command.ExecuteNonQuery(); line, the program just stops. It doesn't throw an exception, it doesn't even go to the last bracket of the method, the program just exits. So, any idea what this might be? Thanks a lot! Edit: Here's a clearer example:

        private void SetSystemEnviroment()
        {
        try
        {
        using (OracleCommand command = this.con.CreateCommand())
        {
        command.CommandText = "SetSystemEnviroment";
        command.CommandType = CommandType.StoredProcedure;

                        command.ExecuteNonQuery();
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                    return;
                }
            }
        

        Again, after the command.ExecuteNonQuery(); line, it just stops the execution of the program, no warnings, no exceptions, nothing.

        modified on Monday, July 25, 2011 6:23 PM

        H Offline
        H Offline
        Herman T Instance
        wrote on last edited by
        #3

        I miss the Command.Connection.Open() before you executeNonQuery()

        In Word you can only store 2 bytes. That is why I use Writer.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups