1

Am using SQLCommand to make an insert query like following:

db.Database.SQLCommand("sql statement" , "pars");

but when i type Arabic (Unicode) text into the SQL statement it's only shows question marks in the database.

and when i do it as a database query in SQL Server management studio it works fine! please help

  • 1
    Is your database column type nvarchar? Did you try [prefixing your value](http://stackoverflow.com/a/10530373/205233) with `N` to signify it as unicode? Example: `N'باالالا'` – Filburt May 06 '16 at 07:10
  • prefix `n` in sql datatypes tells to SQL Server I would like to store unicode text ,so you should modify `text` to `ntext` , `varchar` to `nvarchar` and so on – sepehr May 06 '16 at 07:16
  • Please refer this - http://stackoverflow.com/questions/33912486/update-a-varchar-column-with-arabic-names-in-sql/33913090#33913090 –  May 06 '16 at 07:27

1 Answers1

2

You need to set the collation for you database to be arabic, and also that of the table column.

Also make sure the column is NVARCHAR and not VARCHAR

enter image description here

enter image description here

Zein Makki
  • 29,485
  • 6
  • 52
  • 63