trouble inserting unicode values by command text
450721Apr 4 2006 — edited Apr 11 2006Hi everyone,
I have one table in Oralce 10g: tblUnicode (name nvarchar2(100)), I'm using Oracle.DataAccess.dll version 10.2.0.100.
When I insert a row with parameterized query:
string commText = "insert into tblUnicode values (:a)";
OracleCommand comm = new OracleCommand(commText, conn);
comm.Parameters.Add("a", OracleDbType.NVarchar2, 100).Value = "Unicode string";
comm.CommandType = CommandType.Text;
comm.ExecuteNonQuery();
=> everything is ok (the Unicode string is stored correctly in database)
but, when I try to put value in the single query (not using parameter)
string commText = "insert into tblUnicode values (N'Unicode string')";
OracleCommand comm = new OracleCommand(commText, conn);
comm.CommandType = CommandType.Text;
comm.ExecuteNonQuery();
=> the value is inserted to database is not correct '?*^&#'
Anyone knows why?
Thanks in advanced.