Здравствуйте! Суть проблемы - есть некая строка, а именно - “Sometimes,' said Pooh, 'the smallest things take up the most room in your heart.”, если вставить ее в поле в бд через oracle sql developer - она вставляется корректно, если через приложение на asp.net, то вот такой результат: ¿Sometimes,' said Pooh, 'the smallest things take up the most room in your heart.¿
Наставьте на путь истинный. Спасибо.
Тип поля в БД - NVARCHAR2
Хранимая процедура в пакете:
I_Comment - интересующее нас поле
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
);
Хранимая процедура в теле пакета:
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;
Нужная строка в коде
dataHelper.AddParameter("i_Priority", ParameterDirection.Input, DbType.Int32, newsFlash.Priority);
И код из c#:
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);
}
}