title: Calling an Oracle insert stored procedure from C#
body: <p>Stored procedure:</p>
  
  <pre><code>CREATE OR REPLACE PROCEDURE insertMovie(
     p_m_id IN MOVIE.M_ID%TYPE,
     p_movie_name IN MOVIE.MOVIE_NAME%TYPE,
     p_year IN MOVIE.YEAR%TYPE,
     p_category IN MOVIE.CATEGORY%TYPE)
  IS
  BEGIN
    INSERT INTO MOVIE ("M_ID", "MOVIE_NAME", "YEAR", "CATEGORY") 
    VALUES (p_m_id, p_movie_name,p_year, p_category);
  END;
  /
  </code></pre>
  
  <p>This is the procedure I have created to insert data into the <code>movie</code> table. Now I am trying to call it from by C#. I have tried the following code but it's not working.</p>
  
  <p>A little help in this regard will be much appreciated. Thank you</p>
  
  <pre><code>    private void button1_Click(object sender, EventArgs e)
      {
          dbConnection conObj = new dbConnection();
          OracleConnection theConn = conObj.connFunc();
  
          String p_m_id, p_movie_name, p_year, p_category;
          p_m_id = movie_id.Text;
          p_movie_name = movie_name.Text;
          p_year = year.Text;
          p_category = category.Text;
  
          OracleParameter parChoiceIn = new OracleParameter();
          OracleParameter parDataIn = new OracleParameter();
          OracleParameter parOut = new OracleParameter();
  
          parChoiceIn.ParameterName = "p_m_id";
          parChoiceIn.OracleType = OracleType.Number;
          parChoiceIn.Size = 32;
          parChoiceIn.Direction = System.Data.ParameterDirection.Input;
          parChoiceIn.Value = p_m_id;
  
          parDataIn.ParameterName = "p_movie_name";
          parDataIn.OracleType = OracleType.VarChar;
          parDataIn.Size = 32;
          parDataIn.Direction = System.Data.ParameterDirection.Input;
          parDataIn.Value = p_movie_name;
  
          parDataIn.ParameterName = "p_year";
          parDataIn.OracleType = OracleType.Number;
          parDataIn.Size = 32;
          parDataIn.Direction = System.Data.ParameterDirection.Input;
          parDataIn.Value = p_year;
  
          parDataIn.ParameterName = "p_category";
          parDataIn.OracleType = OracleType.VarChar;
          parDataIn.Size = 32;
          parDataIn.Direction = System.Data.ParameterDirection.Input;
          parDataIn.Value = p_category;
  
          OracleCommand cmd = theConn.CreateCommand();
          cmd.CommandType = System.Data.CommandType.StoredProcedure;
          cmd.CommandText = "insertMovie";
          cmd.Parameters.Add(parChoiceIn);
          cmd.Parameters.Add(parDataIn);
          cmd.Parameters.Add(parOut);
  
          theConn.Open();
  
          OracleDataAdapter adapter = new OracleDataAdapter(cmd);
          DataSet myset = new DataSet("theResCur");
          adapter.Fill(myset);
          theGrid.DataSource = myset;
          theGrid.DataSource = myset.Tables[0];
  
          theConn.Close();
      }
  }
  </code></pre>