none
Non Display of Arabic characters RRS feed

  • Question

  • I have a table with a field which is of the type nvarchar(50).
    When I open the table with ssms and edit the table and paste arabic
    characters directly, the data is displayed in Arbic. However when
    I try to insert the arabic characters thru a C# program in Visual
    studio 2010 program the data is inserted but instead of the Arabic
    characters it is displaying ????? . How to solve the problem. Thanking
    you in advance
    Binny Mathew
    Monday, March 31, 2014 11:14 AM

Answers

  • Hello,

    I think the solution from Guffa would be helpful. One way is to insert the unicode characters in the database sending the text as unicode by using a parameter type like nvarchar / SqlDbType.NVarChar.

    Another way is to add the N before a string literal to make it Unicode as:

    SqlCommand cmd = new SqlCommand("insert into [Order] values(3,N'AAA')", connection);

    You can have a try, if this does not work for you, please let me know.

    Regards.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, April 1, 2014 2:49 AM
    Moderator

All replies

  • Hello,

    I think the solution from Guffa would be helpful. One way is to insert the unicode characters in the database sending the text as unicode by using a parameter type like nvarchar / SqlDbType.NVarChar.

    Another way is to add the N before a string literal to make it Unicode as:

    SqlCommand cmd = new SqlCommand("insert into [Order] values(3,N'AAA')", connection);

    You can have a try, if this does not work for you, please let me know.

    Regards.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, April 1, 2014 2:49 AM
    Moderator
  • Thank you Fred Bao. I added N before the string and it worked.

    Binny

    Tuesday, April 1, 2014 5:45 AM