Click here to Skip to main content
15,888,351 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Hello all,
I am working with service-based database in visual studio 2015 and entity framework and LinqToSql.

the problem: if any Arabic data inserted or updated to table it show as ???? (using linq to sql)


so i need a way to change the collation of my (service-based database) to anything that accept Arabic data.

many thanks in advance

What I have tried:

searched a long to change collation but no result.
Posted
Updated 7-Nov-19 12:31pm

1 solution

Quote:
if any Arabic data inserted or updated to table it show as ???? (using linq to sql)
Do you use Unicode while storing the data in the database? If so, make sure that your columns also support Unicode data—or specify Arabic collation. The reason behind "???" in the data is that by the time you see "???", your data has been lost. Your tables need to support the Unicode code points—Entity Framework, if I am not wrong, would automatically take care of mapping to Unicode internally—so that it can take in Unicode data, and return the Unicode data.

Here is a quick test that can help you understand why this problem is arising; sql server - store arabic in SQL database - Stack Overflow[^].

Read this article of mine to explore a bit more on this topic, Reading and writing Unicode data in .NET[^]

Quote:
so i need a way to change the collation of my (service-based database) to anything that accept Arabic data.
Check out this Microsoft documentation to learn how to do that, note that once the database has been created you can only do this using T-SQL and not using SQL Server Management Studio, Set or Change the Database Collation - SQL Server | Microsoft Docs[^].
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900