Polish letter from MySql database in C# RRS feed

  • Question

  • User558783729 posted


    I want to connect to MySql database. In the properties of the database through SQL Manager I see the database is coded character set latin1 (ISO 8859-1 West European). At the time when the sql to execute commands remotely via EMS i no get the polish world. 

    Now i want to only read some data from myssql using MySql connector:

    <add assembly="MySql.Data, Version=, Culture=neutral, PublicKeyToken=C5687FC88969C44D"/>

    How to get polish worlds from mySql database in C# Visual Studio web project on aspx page ?

    Monday, December 21, 2009 6:38 AM

All replies

  • User558783729 posted

    I tried to use enconding but all the characters (replace the bushes on my character to "?")

     Encoding encoding = Encoding.GetEncoding ( "iso-8859-1");
    Encoding2 encoding = Encoding.GetEncoding ( "utf-8");
    byte [] result;
    byte [] source;
    source = encoding2.GetBytes (DropDownList1.SelectedValue.ToString ());
    result = Encoding.Convert (encoding2, encoding, source);
    string test1 = encoding.GetString (result);

    Monday, December 21, 2009 6:52 AM