G
Guest
This has probably been addressed before, but I couldn't find it in the
archives.
I try to store unicode data with ado.net. I'm using VS2005 and C++.
In order to find Unicode data I have copied some text from www.unicode.org
I have taken out the most important parts from my code in order to show what
I try to do. I have a __wchar_t string that I try to run with SqlCommand.
__wchar_t SQLStr[20000];
wcscpy(SQLStr,L"INSERT INTO ccc (ccc_id,data) VALUES (12690,'Czech -
PoÄÃtaÄe, ze své podstaty, pracujà pouze s ÄÃsly Greek - Οι ηλεκτÏονικοί')");
....
m_SQLSCommand = new System:ata::SqlClient::SqlCommand(SQLStr, Conn);
....
It is finally executed with ExecuteNonQuery()
The problem is that when I look in the database and try to read it it looks
like this
"Czech - PocÃtace, ze své podstaty, pracujà pouze s cÃsly Greek - ??
??e?t???????"
If I insert the same data with SQL Enterprise Manager, I can read it with
ADO.NET. But I can't insert it correct from my program.
When I run the program in debug-mode, the text looks fine all the way.
The datatype that I'm inserting to is NVARCHAR
What could be the problem?
Thorsten
archives.
I try to store unicode data with ado.net. I'm using VS2005 and C++.
In order to find Unicode data I have copied some text from www.unicode.org
I have taken out the most important parts from my code in order to show what
I try to do. I have a __wchar_t string that I try to run with SqlCommand.
__wchar_t SQLStr[20000];
wcscpy(SQLStr,L"INSERT INTO ccc (ccc_id,data) VALUES (12690,'Czech -
PoÄÃtaÄe, ze své podstaty, pracujà pouze s ÄÃsly Greek - Οι ηλεκτÏονικοί')");
....
m_SQLSCommand = new System:ata::SqlClient::SqlCommand(SQLStr, Conn);
....
It is finally executed with ExecuteNonQuery()
The problem is that when I look in the database and try to read it it looks
like this
"Czech - PocÃtace, ze své podstaty, pracujà pouze s cÃsly Greek - ??
??e?t???????"
If I insert the same data with SQL Enterprise Manager, I can read it with
ADO.NET. But I can't insert it correct from my program.
When I run the program in debug-mode, the text looks fine all the way.
The datatype that I'm inserting to is NVARCHAR
What could be the problem?
Thorsten