How use unicode in Oracle with ADO.NET

I created one table in Oracle by statement :

create table Test2
(id integer,
Ten nvarchar2(50)
)

and I write one application by C# to insert data into Oracle Database :

 OleDbConnection conn = new OleDbConnection("Provider=MSDAORA;Data Source=hbk;Persist Security Info=True;User ID=hbk;Password=hbk;Unicode=True;");

 conn.Open();

OleDbCommand cmd = new OleDbCommand("insert into Test2(ID,Ten) values(10,N'Nguyễn thị hồng nhung')", conn);
cmd.ExecuteNonQuery();

conn.Close();


I retrieved data that inserted by snip code:

 OleDbConnection conn = new OleDbConnection("Provider=MSDAORA;Data Source=hbk;Persist Security Info=True;User ID=hbk;Password=hbk;Unicode=True;");
            conn.Open();
            OleDbCommand cmd = new OleDbCommand("select * from Test2", conn);
            DataSet ds = new DataSet();
            OleDbDataAdapter da = new OleDbDataAdapter(cmd);
            da.Fill(ds);
            dataGridView1.DataSource = ds.Tables[0];
            conn.Close();

but result :
ID  : 10
Ten : Nguy?n th? h?ng nhung

This mean unicode character stored incorrect. I don't know what's error ? 
Please help me !!!!!!!!!!!!
0
quocvuong2005
11/29/2006 6:02:34 AM
asp.net.oracle 2269 articles. 0 followers. Follow

3 Replies
2755 Views

Similar Articles

[PageSpeed] 38

Hi,

    Which version of Oracle is it?. If it is Oracle9i, check if the Database Parameters are set up to UTF8. I too had the same issue but when I used Oraoledb.Oracle instead of MSDORA, it works fine. try to change ur connection string to  OleDbConnection conn = new OleDbConnection("Provider=OraOLEDB.Oracle;Password=alpha2100;User ID=toast;Data Source=devtoast.sin.infineon.com;Persist Security Info=True" )

Regards,

Nandini

 

 

2
nandini_net_in
11/30/2006 3:54:45 AM

I use oracle version 9.2 . And Database parametres are :

NLS_LANGUAGE    AMERICAN
NLS_TERRITORY    AMERICA
NLS_CURRENCY    $
NLS_ISO_CURRENCY    AMERICA
NLS_NUMERIC_CHARACTERS    .,
NLS_CHARACTERSET    AL32UTF8
NLS_CALENDAR    GREGORIAN
NLS_DATE_FORMAT    DD-MON-RR
NLS_DATE_LANGUAGE    AMERICAN
NLS_SORT    BINARY
NLS_TIME_FORMAT    HH.MI.SSXFF AM
NLS_TIMESTAMP_FORMAT    DD-MON-RR HH.MI.SSXFF AM
NLS_TIME_TZ_FORMAT    HH.MI.SSXFF AM TZR
NLS_TIMESTAMP_TZ_FORMAT    DD-MON-RR HH.MI.SSXFF AM TZR
NLS_DUAL_CURRENCY    $
NLS_COMP    BINARY
NLS_LENGTH_SEMANTICS    BYTE
NLS_NCHAR_CONV_EXCP    FALSE
NLS_NCHAR_CHARACTERSET    UTF8
NLS_RDBMS_VERSION    9.2.0.1.0

But where do I get  Oraoledb.Oracle ? . Could you plese tell me . Thank you

0
quocvuong2005
11/30/2006 5:29:24 AM
I see your idea . Thank you for your rely . I try do following your instruction and it worked fine
1
quocvuong2005
11/30/2006 5:49:54 AM
Reply:

Similar Artilces:

Return an Oracle Ref Cursor to a .NET DataReader object by using the .NET Managed Provider for Oracle
Hello, I am wondering if anyone in this community knows the shorter way to return an Oracle Ref Cursor to a .NET DataReader object by using the .NET Managed Provider for Oracle, something likereturn (IDataReader) SqlHelper.ExecuteReader(ConnectionString, "GET_ACCOUNT", Id); instead of using the way below (look at the C# code) Stored Procedure create or replace PROCEDURE "GET_ACCOUNT" ( p_ID IN ACCOUNT.ID%type, retCursor OUT SA.MYGEN.sqlcur ) IS BEGIN OPEN retCursor FOR SELECT ID, NAME FROM ACCOUNT WHERE ID = p_ID ; ...

which is shou i use? Microsoft .NET Framework 1.1 Data Provider for Oracle and the Oracle Data Provider for .NET
Microsoft .NET Framework 1.1 Data Provider for Oracle and the Oracle Data Provider for .NETI am confused?Which is better or which one should I use?BTW, I am going to use .net 2.0 with oracle 9. Can anyone tell me what shou I use for working with oracle database?Thanks very much in advance!Justin Oracle's data provider has more functionality than Microsoft's.If your doing transaction processing you can have SAVEPOINTs, which Microsoft's data provider does not provide.Also, Oracle has PL/SQL Associative Arrays which are very powerful.Oracle also allows you to bind parameters by name and pos...

urgent: .NET Provider for Oracle or Oracle Data Provider for .NET
If I want to access Oracle DB in ASP.NET application, and I am using .NET Provider for Oracle or Oracle Data Provider for .NET, should I have to install OracleClient on my .NET server? Is there other choice? Thank you very much.Johnson Johnson2007:should I have to install OracleClient on my .NET server?  You have to options1. install the ODP.NET on your web serverOR2. put the oracle assemblies in your BIN directory   Hi jimmy,Thank you for you reply. Because I could not find a server right now, I should test it first before I agree or disagree with you, as most articles I...

Passing boolean values to oracle function / procedure from C#.Net
Hi,  I dont know how to pass boolean values to oracle function / procedure arguments, could you please help me to know ?  Thank you, Sreedhar After spending lot of time on google, I understand C#.Net doest support PL/SQL boolean values. Thanks Sreedhar...

Problem with Oracle Stored Procedures using ODP.NET in VB.NET (VS 2003)
This is the stored procedure,Procedure RetrieveReservations(pProperty In Varchar2,pResHeaderId In Varchar2,pEmail In Varchar2,pPasswd In Varchar2,ResultSet In Out ResCursor);This is the old .asp code (part of it)objConn.ConnectionString = Application("BackEndConnection_ConnectionString")objConn.Open objComm.ActiveConnection = objConn objComm.CommandText = "internet_package.RetrieveReservations"objComm.CommandType = adCmdStoredProc objComm.Parameters.Append objComm.CreateParameter("pProperty", adVarChar , adParamInput, 8, Request.QueryString("propid"))objComm.Parameters.Append objComm.Crea...

How call a Oracle Function using Microsoft .Net Oracle Client (System.Data.OracleClient)?
I try to call Oracle Function in .net C# by using System.Data.OracleClient. But i am not successful. Here is my code FUNCTION TTHAO_MONTT_EXISTS ( vten varchar2) RETURN boolean IS ret boolean; montt_id integer; BEGIN ret:=false; montt_id:= -1; select monthethao_id into montt_id from TTHAO_MONTHETHAO where ten = vten; if montt_id!=-1 then ret:=true; end if; return ret; Exception when others then return false; END; I do not know, when I call function TTHAO_MONTT_E...

Saving multiple rows in Oracle DB using ADO.NET
Hi,  I want to know how we can save multiple rows (gridview data) in Oracle DB (using ADO.NET) using a single connection.   Rgds u can use datatable.copy method. Thank uBabaPlease remember to click "Mark as Answer" on this post if it helped you. Hi,   Thanks for your reply. Can you please send me a sample code?   Rgds, Jai...

Sending SMS using vb.net or C#.net using vb.net or c#.net
Hi  My requirement is I hav one csv file with these fields id,mobilenum,messgae,status.intiallu staus is 0. once i read the all fileds and take that mobile number.using tat mobile number  i need to send sms .after sending sms i shuld change status as 1 How to send sms thru coding (please dont provide any links.if it is provide also please give working links becox i checked codeproject .i didnt get any nice link. and also provide the how to update the status field im csv file   Thank ssandhya   To send SMS, you need some third party SMS providers. if you consul...

Oracle store procedure problem using Powerbuilder and Oracle 8.0.4.0 Net
Powerbuilder version 6.0.00 / 6.5 Build 444 Oracle Net 8.0.4.0 I found there is problem with Oracle store procedure having more than 6 in parameters. I got GPF error on Window 95 and Dr. Watson error on NT. Also, I found it works find in Oracle Net 8.0.3.0. Is this a bug? Is there any new patch for this if it is a bug. Any recommendation about What version Oracle Net or SQL Net should I used for Oracle server version 8.0.4.0 (I don't think I am using any Oracle 8 new features)? Thanks in advance, Sharon Li If you use PB 6.5, you can try the new Oracle 8 driver: ftp...

Oracle Spatial support in Devart's ADO.NET Data Provider for Oracle [Edit]
dotConnect for oracle v. 7.3 http://www.devart.com/dotconnect/oracle/ , ADO.NET Provider from Devart, includes support for Oracle Spatial in the projects, using Entity Framework. Devart Team constantly implements all the available Entity Framework innovations, and shortly after the introduction of DbGeometry and DbGeography classes in Entity Framework 5 has implemented support for Oracle Spatial in the Entity Framework provider for Oracle. Oracle MDSYS.SDO_GEOMETRY object type can now be mapped to DbGeometry and DbGeography classes. Now dotConnect for Oracle includes new versions of Devar...

.NET Oracle Provider
Hi all,I am using .NET 2.0 Frameworks Oracle provider and it does not have a OracleDbTypes Type for me to use. I would like to create a parameter that is of the Oracle type NVARCHAR, but it seems I can only use DbTypes, which does not have this. If I used DbTypes.String, would this be ok, otherwise, how else can I be more specific about the Oracle Parameter data type?Thanks  can u explain which type of data u r going to storeThank uBaba Thank uBabaPlease remember to click "Mark as Answer" on this post if it helped you. What's your version of ODP? You have OracleD...

Oracle ODP.net mulitple Oracle Client
To connect to the oracle database using ODP.net, the applicate must add the dll file called Oracle.DataAccess. There are a lot of version of Oracle.DataAccess. As I know, if the client use Oracle Client 10g Release 2. If the client use Oracle Client 10g Release 2, the application also have to use the Oracle.DataAccess the come from Oracle Client 10g Release 2.  My question is that there are any method to add more than one Oracle.DataAccess version in my product to support multiple OracleClient.   That should automatically happen for the most part.  Oracle's ODP.NET i...

Which .Net Provider for Oracle 9i Microsoft or Oracle
Can anyone provide me pros and cons of provider to access Oracle Database ? I am aware of Microsoft Provider and Oracle Provider. Microsoft http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/manprooracperf.asp Oracle http://otn.oracle.com/software/tech/windows/odpnet/utilsoft.html I guess you can use either. But as some post suggests, if both installed, then MS ODP will not work. I've been using DataDirect Technologies Connect for .Net and Oracle. It's not free, so it depends on your budget. The speed improvements were great for us, and it's ni...

Insert datetime, using ADO.net VB.net
Hello there,I got a little code there are inserting a record into my msSQL database..But i cant insert the datetime, for one reason?The problem is in line 7 () where i want to insert DateTime.Now 1 Protected Sub SendPmTilAfviste(ByVal modtager As String, ByVal festID As String) 2 ' Connection 3 Dim conn As SqlConnection = New SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\ASPNETDB.MDF;Integrated Security=True;User Instance=True") 4 conn.Open() 5 6 ' SQL-kommandoen 7 Dim cm...

Web resources about - How use unicode in Oracle with ADO.NET - asp.net.oracle

UnicodeNepali.com - Unicode Nepali Converter and Tools
Unicode Nepali Converter. Unicode Nepali typing with any standard keyboard. Simply type in Roman and it will convert into Unicode Nepali. Won't ...

Search form - searching for Unicode characters by name
For example, searching for ampersand finds U+0026 AMPERSAND as well as other ampersand characters.Searching for coptic finds letters with COPTIC ...

Unicode Consortium
Welcome! The enables people around the world to use computers in any language. Our freely-available specifications and data form the foundation ...

Monospace (Unicode) - Wikipedia, the free encyclopedia
Monospace is a monospaced Unicode font , developed by George Williams . This font contains 2,862 glyphs . It includes characters in the following ...

Unicode - Wikipedia, the free encyclopedia
This article contains special characters . Without proper rendering support , you may see question marks, boxes, or other symbols . Unicode is ...

Emoji Free Emoticon Keyboard Art Text Pics Unicode for Tumblr Twitter Zoosk Facebook Instaframe Keynote ...
Get Emoji Free Emoticon Keyboard Art Text Pics Unicode for Tumblr Twitter Zoosk Facebook Instaframe Keynote iPages Kik Messenger KakaoTalk MMS ...

Unicode Consortium approves 36 new emoji including selfie, bacon, face palm
... good news for those who have a face palm moment or need to express their love of bacon or selfies — new emoji are on their way. The Unicode ...

Unicode Consortium approves 36 new emoji including selfie, bacon, face palm
... good news for those who have a face palm moment or need to express their love of bacon or selfies — new emoji are on their way. The Unicode ...

Unicode update lets you say 'spider,' 'dark glasses' in pictures
Unicode, the character-encoding standard that underpins a vast amount of the Internet and many computing applications, has been updated to include ...

Black emoji may finally be on the way, Unicode report reveals
Note: The CBC does not necessarily endorse any of the views posted. By submitting your comments, you acknowledge that CBC has the right to reproduce, ...

Resources last updated: 2/13/2016 4:57:43 AM