Click here to Skip to main content
15,943,477 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Friends,

This is regarding an issue in application.

In a textbox, we have set the font of a textbox as Kruti Dev 010.

While typing the text is shown in hindi.

But when we convert it into string say,

Dim s As String = txthindiname.Text

This string shows the data in english, and vice versa the data is stored in sql as english only.

However, when we run a direct query in Sql server, the data in the table is stored in hindi text.

We have set the datatype of the field as nvarchar and in query we are using the prefix N’.

So, we believe the issue lies on the part.

Friends, we really want your help to solve this issue.

Thanks in advance.

What I have tried:

In sql server, when we directly enter the data through a query, the data is stored in hindi text, but when stored through, the data gets saved in english text.
Updated 25-Sep-22 8:36am
Richard MacCutchan 9-Sep-22 8:25am    
"the data is stored in sql as english only."
No, the data is store exactly as it was entered into your program. However, when you try to display it it will use whatever default font is in use. So you need to set the correct font when you display it.
Member 15100152 15-Sep-22 0:03am    
Thanks for your reply. One thing I observe that when we paste a hindi word in textbox and save it to database, it saves the text in hindi. But when we type in hindi, on the front end it shows in hindi but at the backend it shows in english.

1 solution

The problem lies in the database. Please, read about COLLATION and UNICODE[^].
Share this answer
Member 15100152 9-Nov-22 2:01am    
In database, we are directly able to store data in hindi through insert statement. But when storing data through textbox, it shows data in hindi, but in code, the data is coming in english.

txthindiname.text = ikik

Please note here the data is shows in english.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900