Ahmed Abdulrahman
Ahmed Abdulrahman

Reputation: 33

How to insert Arabic text via SQLCommand in SQL Server using C#

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

Upvotes: 1

Views: 3517

Answers (1)

Zein Makki
Zein Makki

Reputation: 30022

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

Upvotes: 2

Related Questions