List:MySQL and .NET« Previous MessageNext Message »
From:Gary Wong Date:September 23 2004 6:47am
Subject:Does "Mysql Connector/Net provider" support unicode chinese charactor?
View as plain text  
Hi,

Does "Mysql Connector/Net provider" support unicode chinese charactor?
I try with following codes to insert a unicode chinese string in parament
"?a1", but it does not work, the chinese charactor stored as ???? in mysql
database.

Any comment? Please help! Thanks

Gary
=======================================

        Dim myConnectionString As String = ""
        Dim sQuery As String = ""

       myConnectionString = "Database=test;Data Source=localhost;User
Id=root;Password=;"

        Dim myConnection As New MySqlConnection(myConnectionString)

        Dim myInsertQuery As String = "INSERT INTO activitydef (ShortName,
Type, Filter, Description, CreatedBy, CreatedDateTime, LastUpdatedBy,
LastUpdatedDateTime) "
        myInsertQuery &= " Values(?a1, 'Type', 'Filter', 'Desc', '', '', '',
'')"

        Dim myCommand As New MySqlCommand(myInsertQuery)

        Dim op As MySqlParameter = myCommand.Parameters.Add(New
MySqlParameter("?a1", MySqlDbType.VarChar, 100))
        op.Direction = ParameterDirection.Input
        op.Value = sInput
        myCommand.Connection = myConnection
        myConnection.Open()
        myCommand.ExecuteNonQuery()
        myConnection.Close()

Thread
Does "Mysql Connector/Net provider" support unicode chinese charactor?Gary Wong23 Sep
  • Re: Does "Mysql Connector/Net provider" support unicode chinese charactor?Reggie Burnett27 Oct