0

I have a winform application that connects to an mdf database, the problem I'm facing is that I cannot insert Arabic characters into the database from the winform application, all the inserted characters are converted into question marks.

But inserting Arabic data directly to the database causes no error and data inserted successfully.

All the columns are defined as nvarchar.

So, could anyone please suggest me where the problem is? thanks in advance

Husain Alhamali
  • 823
  • 4
  • 17
  • 32
  • It would be better to see your work as well. – Soner Gönül Feb 04 '16 at 11:18
  • It looks like an encoding problem, although it's hard to tell at which point it originates. You need to tell us a little more about your code. Does user enter the text or is it form a file? What controls do you use? Do you process the text somehow before you send it to DB? And most importantly, what objects you use to insert data into your DB (what DB?) DataSet? Entities? SqlCommand.ExecuteNonQuery??? – Arie Feb 04 '16 at 11:24
  • 1
    if you look at http://stackoverflow.com/a/2881793/5497153 it might give what you need – Jhonie Feb 04 '16 at 11:25
  • Thanks all for your fast responses, @Arie actually yes the user enters the data in a simple form that contains text boxes, ONLY text boxes, the data are never processed before except there is a simple validation that verifies if all fields are filled with data, and the final thing is that I'm using `SqlCommand.ExecuteNonQuery()` – Husain Alhamali Feb 04 '16 at 11:36
  • @Jhonie, thanks dear, Actually yes it gave me what do I need!, the problem is solved now, thanks again – Husain Alhamali Feb 04 '16 at 11:43

0 Answers0