I have the following query in ASP.Net page:
SELECT 'محاولة'
This query is printing a hard coded Arabic word. I am saving this record in a DataTable and then printing on page in GridView (by passing that DataTable to GridView) but this Arabic word is being printed as square boxes.
How to print this word properly on ASP.Net page? I tried using following but it didn't work.
SELECT N'محاولة'
EDIT
Here's my code.
DataTable dt = new DataTable();
string sql = "SELECT 'محاولة'";
command.Connection = con;
command.CommandType = CommandType.Text;
command.CommandText = sql;
reader = command.ExecuteReader();
dt.Load(reader);
And then I am passing this "dt" to gridview control.
GridView1.DataSource = dt;
GridView1.DataBind();
Grid view is printing that Arabic word as square boxes (screenshot below).
Let assume your table structure is as fallow.
Now lets add some demo data.
After adding data correctly there you won't have any problem with loading it asp.net page.