Insert of special characters into db table fails

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
kap
Posts: 4
Joined: Sun 18 Jan 2015 12:17

Insert of special characters into db table fails

Post by kap » Sun 18 Jan 2015 13:17

Hello,

I like to insert a row into my table using dotconnect for MySQL entity framework.

The table contains to fields:

index column (int)
name column (varchar)

Here is my code:

Code: Select all

// insert new value
int NextID = pe.Categories.Select(c => c.CategoryIndex).Max() + 1;

ProductsModel.Category objCategory = new ProductsModel.Category() { CategoryIndex = NextID, CategoryName = category };

pe.AddToCategories(objCategory);
pe.SaveChanges();
The string in the category name is
"W/Ö Emulsion"
The result in the database table is
"W/"
Does anyone know why it cuts the string after the slash? I dont get it...

Thank you.

Best regards,

Philipp

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Insert of special characters into db table fails

Post by Shalex » Mon 19 Jan 2015 10:18

Try using the "Unicode=True;" option in the connection string.

If this doesn't help, please give us the following information:
1) the character set of your MySQL server
2) the version of your MySQL server
3) the build number (x.x.x) of your dotConnect for MySQL
4) the datatypes of the CategoryName property in SSDL and CSDL parts of your model

kap
Posts: 4
Joined: Sun 18 Jan 2015 12:17

Re: Insert of special characters into db table fails

Post by kap » Sun 25 Jan 2015 13:23

Hi Shalex,

using "Unicode=True;" did the job!

Thank you very much.

Best regards,

Philipp

Post Reply