Home All Groups Group Topic Archive Search About

system.data.oracleclient: trouble in insert unicode values

Author
1 Mar 2006 4:27 AM
quylevinh
Hi everybody,

I have one table in Oralce: tblUnicode (name nvarchar2(100))

When I insert a row with these code:

string commandText = "insert into tblUnicode values(:1)";
OralceCommand comm = new OracleCommand(commandText, OpenedConnection);
comm.Parameters.Add("1", OralceType.NVarChar,100).Value="Unicode String";
comm.CommandType = CommandType.Text;
comm.ExecuteNonQuery();

=> everything is ok.

but, when I try to put value in the commandText:

string commandText = "insert into tblUnicode values(N'Unicode String')";
OralceCommand comm = new OracleCommand(commandText, OpenedConnection);
comm.CommandType = CommandType.Text;
comm.ExecuteNonQuery();

=> the value is inserted to Oracle database is not correct '?*^&#'

Anyone knows why?

Thanks

AddThis Social Bookmark Button