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

3
  • 1
    Is your database column type nvarchar? Did you try prefixing your value with N to signify it as unicode? Example: N'باالالا' Commented May 6, 2016 at 7: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 Commented May 6, 2016 at 7:16
  • Please refer this - stackoverflow.com/questions/33912486/… Commented May 6, 2016 at 7:27

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.