473,549 Members | 2,715 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Excel OLEDB reading Chinese characters unicode problem

Hi All

I have an excel sheet with Chinese characters in them.

I'm using the OLEBE 4.0 Jet Driver in C# Microsoft Visual Studio 2005
to read from the Excel sheet and then enter into mySQL database.

The problem isn't with mysql but with C# reading the chinese characters
from Excel.

Right now, All I get with chinese characters is question marks
"?????????"

MY OLEDB driver should be able to support multi-language but it doesn't
seem to be working.

Can anyone help?

Expand|Select|Wrap|Line Numbers
  1. String sConnectionString =
  2. "Provider=Microsoft.Jet.OLEDB.4.0;" +
  3. @"Data Source=C:\language.xls;" +
  4. "Extended Properties=Excel 8.0;";
  5.  
  6. OleDbConnection objConn = new
  7. OleDbConnection(sConnectionString);
  8.  
  9. objConn.Open();
  10.  
  11. OleDbCommand objCmdSelect = new OleDbCommand("SELECT * FROM
  12. [Sheet1$]", objConn);
  13. OleDbDataReader reader = objCmdSelect.ExecuteReader();
  14.  
  15.  
  16. //---
  17. String myConnectionString =
  18. "server=192.168.168.6;uid=xxxx;pwd=xxxxx;database=xxxxxxx_db;";
  19. MySqlConnection myConnection = new
  20. MySqlConnection(myConnectionString);
  21.  
  22. while (reader.Read())
  23. {
  24.  
  25. *this is where I generate my sql query
  26. }
  27.  
  28.  
Sep 12 '06 #1
1 5167
Chris Yan <ch***********@ gmail.comwrote:
I have an excel sheet with Chinese characters in them.

I'm using the OLEBE 4.0 Jet Driver in C# Microsoft Visual Studio 2005
to read from the Excel sheet and then enter into mySQL database.

The problem isn't with mysql but with C# reading the chinese characters
from Excel.

Right now, All I get with chinese characters is question marks
"?????????"
See http://www.pobox.com/~skeet/csharp/d...ngunicode.html

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Sep 12 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2045
by: David A. Caballero J. | last post by:
I have a 3 layer system, SQL Server 2000 database, COM+ dll's (VC++ 6) and ASP frontend, this system has been in production for quite some time using english, spanish and portuguese versions. Now I've been asked to test the system to function with Simplified chinese. The development of the system was outsourced and we don't have communication...
4
6626
by: see_mun_lee | last post by:
I use asp to develop a web page to read an excel file containing Chinese Character then display it in the web page. Unfortunately, I cant display it!!! it will display (?????????). <META HTTP-EQUIV="content-type" CONTENT="text/html; charset=utf-8"> ' create and open the connection to the Excel file Set conn =...
1
2356
by: Anthony Liu | last post by:
I believe that topic related to Chinese processing was discussed before. I could not dig out the info I want from the mail list archive. My Python script reads some Chinese text and then split a line delimited by white spaces. I got lists like
8
11939
by: pabv | last post by:
Hello all, I am having a few issues with encoding to chinese characters and perhaps someone might be able to assist. At the moment I am only able to see chinese characters when displayed as part of a datagrid. When an input textbox is displayed it does not display chinese characters, but rather the unicode characters stored in the mssql...
7
4285
by: c.verma | last post by:
I have a web application. There is a page which has a datagrid on it.The datagrid displays the data that comes from SAP. SAP sends the chinese characters to this grid. Before I display CHinese charactes, I have to use the following code to let it display on the web page: Public Function ToSCUnicode(ByVal str As String) As String Dim enc1252...
6
2483
by: Matt Hollingworth | last post by:
We have an XML file that contains text in various languages , ie English, French, German and Chinese etc. We currently have a StringWriter object that reads this in and transforms against an XslTransform object. the problem arises when we encounter Chinese characters; these characters just come out as garbage in the internet explorer browser....
19
32762
by: many_years_after | last post by:
Hi,everyone: Have you any ideas? Say whatever you know about this. thanks.
6
4277
by: Bill Fuller | last post by:
I believe that C# uses Unicode by default for string characters. Does that mean that double-byte langauges such as Chinese can be used without doing anything special... including DB persistance? I.e., are all characters automatically double-byte?
5
8501
by: Figmo | last post by:
I'm having a problem working with foreign characters (well....foreign to me anyway) I have a textbox control on a form. The font is set to MS Arial Unicode. If I use the Chinese input method I can type characters into this box no problem. They display correctly. I can also copy and paste Chinese characters from web sites into this text...
0
7518
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7444
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7711
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7805
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5085
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3478
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1932
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1054
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
755
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.