Complete Example a la Hello World
Posted by: Matha Goram
Date: April 07, 2017 06:56AM

Hello!

Is there a complete example that one could use for stepwise refinement to illustrate the bridging between Windows-1252 and UTF-8? MySQL is running on a Debian Jessie platform and I am able to emulate the initial examples (including SELECT and INSERT) in Connector/.NET guide using C#.

However, when I use similar code using the RT dll (for Windows IoT Core) for the client to the same MySQL instance, I run into the character set issue that is explained in thorough detail in the docs available through this site. However, I do not know how to apply the guidance! Being a little naïve, I need a monkey-see-monkey-do code snippet.

Here is what doesn't work on the Windows 10 IoT Core platform (but does in a Windows 10 desktop platform):

string connStr = "Server=...;Database=...;Uid=...;Pwd=...;port=3306;SslMode=None;charset=utf8;";
MySqlConnection conn = new MySqlConnection(connStr);
try
{
conn.Open();
string rtn = "myProc";
MySqlCommand cmd = new MySqlCommand(rtn, conn);
cmd.CommandType = MySql.Data.MySqlClient.CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("Coln", "Valuen");
MySqlDataReader rdr = cmd.ExecuteReader();
...

An exception is thrown for the ExecuteReader method for the character set incompatibility, "Windows-1252 is not a supported encoding name."

What changes do I need to make (e.g. Encoding.UTF8 and related methods) to ensure proper processing by this simple app?

Thanks.

Options: ReplyQuote


Subject
Views
Written By
Posted
Complete Example a la Hello World
1022
April 07, 2017 06:56AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.