title: Passing parameters with a stored procedure to oracle from asp.net
body: <p>I have a string: <em>“Sometimes,' said Pooh, 'the smallest things take up the most room in your heart.”</em>. When I insert this string into Oracle database using Oracle SQL Developer it works fine, but when I'm using ASP.net application I get this: <em>¿Sometimes,' said Pooh, 'the smallest things take up the most room in your heart.¿</em></p>
  
  <p>Could you help me?</p>
  
  <p>Type of field in database - <strong>NVARCHAR2</strong></p>
  
  <p>Name of filed - <strong>I_Comment</strong></p>
  
  <p>Stored procedure from package:</p>
  
  <pre><code>PROCEDURE INSERTNEWSFLASH
  (
  i_StartTime DATE,
  i_EndTime DATE,
  i_Comment NVARCHAR2,
  i_Priority NUMBER,
  i_Type NUMBER,
  i_AirlineCode VARCHAR2,
  o_NewsFlashId out NEWSFLASH.NEWSFLASHID%type
  );
  </code></pre>
  
  <p>Stored procedure in package's body: </p>
  
  <pre><code>PROCEDURE INSERTNEWSFLASH
  (
  i_StartTime DATE,
  i_EndTime DATE,
  i_Comment NVARCHAR2,
  i_Priority NUMBER,
  i_Type NUMBER,
  i_AirlineCode VARCHAR2,
  o_NewsFlashId out NEWSFLASH.NEWSFLASHID%type
  ) AS
  BEGIN
    SELECT NEWSFLASHID_SEQ.nextval into o_NewsFlashId from dual;
    INSERT INTO NEWSFLASH
    (
      NEWSFLASHID,
      VALIDFROMDATE,
      VALIDTODATE,
      NEWSFLASHTEXT,
      NEWSFLASHPRIORITY,
      NEWSFLASHTYPE,
      AIRLINECODE
    )
    values
    (
      o_NewsFlashId,
      i_StartTime,
      i_EndTime,
      i_Comment,
      i_Priority,
      i_Type,
      i_AirlineCode
    );
  END INSERTNEWSFLASH;
  </code></pre>
  
  <p>C# code:</p>
  
  <pre><code>public int Add(NewsFlashModel newsFlash)
      {
          using (IDataHelper dataHelper = dataHelperFactory.GetDataHelper(StaffTravelSettings.ConnectionStrings.ITravelDatabase))
          {
              dataHelper.AddParameter("i_StartTime", ParameterDirection.Input, DbType.Date, newsFlash.ValidFromDate);
              dataHelper.AddParameter("i_EndTime", ParameterDirection.Input, DbType.Date, newsFlash.ValidToDate);
              dataHelper.AddParameter("i_Comment", ParameterDirection.Input, DbType.String, newsFlash.NewsText);
              dataHelper.AddParameter("i_Priority", ParameterDirection.Input, DbType.Int32, newsFlash.Priority);
              dataHelper.AddParameter("i_Type", ParameterDirection.Input, DbType.Int32, (int) newsFlash.Type);
              dataHelper.AddParameter("i_AirlineCode", ParameterDirection.Input, DbType.String, newsFlash.AirlineCompanyCode);
              IDataParameter parameter = dataHelper.AddParameter("o_NewsFlashId", ParameterDirection.Output, DbType.Int32);
              dataHelper.ExecuteNonQuery("NEWSFLASH.INSERTNEWSFLASH");
              return Convert.ToInt32(parameter.Value);
          }
      }
  </code></pre>