-1

I have a local DB in SQLyog and WindowsFormApplication which is connected to that database. I am from Serbia, so I want to insert and our special characters (š, ć, đ, č, Š, Ć, Đ, Č). I have set DB collation to be UTF-8. But, this seems not to work. When I execute the INSERT command in SQL, i get the proper value filled when I execute SELECT command and everything works just fine. But, in C# when I try to run insert, some characters are replaced, like č, ć, đ, Ć, Č, with c, c, d, C, C but Đ works as it should.

Example: When I enter from C# ćććććććć I get in SELECT clause cccccccc.

My code is provided below. I think C# is wrong somewhere here.

C# code:

http://pastebin.com/19u35GsG

The DB is very simple. Just a one column with ID and VAL which is value we insert. This can be easily checked.

How can I resolve this issue?

  • Possible duplicate of [c# mysql AddWithValue unicode](http://stackoverflow.com/questions/29869645/c-sharp-mysql-addwithvalue-unicode) – Rick James May 25 '16 at 04:26
  • Voting to close. Short answer: need something like this in connection string: `id=my_user;password=my_password;database=some_db123;charset=utf8;` – Rick James May 25 '16 at 04:26

1 Answers1

-1

whats the type of column?

look here :

Reading signs like č ć đ š ž from MySql database

Community
  • 1
  • 1