|
-
Sep 28th, 2013, 12:34 PM
#1
Thread Starter
Hyperactive Member
Can we Type Hindi In Windows Application Textbox
My SQL Server is dsplaying Unicode Characters.
Code:
declare @demo nvarchar(100)
set @demo = N'यह एक'
select @demo
I want to insert Hindi in SQL from .Net, I am sending the Text "sonia"(IN ENGLISH) with N Before it.
Code:
cmd = new SqlCommand("INSERT INTO hindi(Name) VALUES (N'sonia')", con);
cmd.ExecuteNonQuery();
IN SQL, sonia is saved in english format only. I want the sonia to insert in HINDI FORMAT(सोनिया ) .. How its possible??
PLEASE HELP ME!!!
-
Sep 28th, 2013, 03:42 PM
#2
Re: Can we Type Hindi In Windows Application Textbox
As with any string variable what is stored in any nvarchar field is merely a list of character values. It is not English or any other language, merely a chain of numbers. What turns it into English in any display is the font used in that display. So if you display the value using a Hindi font then it becomes Hindi. There's no magic to that. This does mean that you've given yourself a bit of a problem if you're going to display the prefix 'N' in English and the remainder in Hindi of course because few controls give you the native ability to display more than one font at a time.
As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"
Reviews: "dunfiddlin likes his DataTables" - jmcilhinney
Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!
-
Sep 29th, 2013, 05:04 PM
#3
Re: Can we Type Hindi In Windows Application Textbox
 Originally Posted by dunfiddlin
...because few controls give you the native ability to display more than one font at a time.
You're forgetting the rtb which will let you use as many different fonts as you like.
@ sonia: When saving to SQL, use the rtb's rtf property + not its text property
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Sep 30th, 2013, 08:35 AM
#4
Re: Can we Type Hindi In Windows Application Textbox
 Originally Posted by sonia.sardana
My SQL Server is dsplaying Unicode Characters.
Code:
declare @demo nvarchar(100)
set @demo = N'यह एक'
select @demo
I want to insert Hindi in SQL from .Net, I am sending the Text "sonia"(IN ENGLISH) with N Before it.
Code:
cmd = new SqlCommand("INSERT INTO hindi(Name) VALUES (N'sonia')", con);
cmd.ExecuteNonQuery();
IN SQL, sonia is saved in english format only. I want the sonia to insert in HINDI FORMAT(सोनिया ) .. How its possible??
PLEASE HELP ME!!!
Okay, wait, so...you want to send SQL Server the word "Sonia" (IN ENGLISH), and expect it to translate it into the Hindi equivalent? Or am I misunderstanding you?
-
Oct 1st, 2013, 01:57 AM
#5
Thread Starter
Hyperactive Member
Re: Can we Type Hindi In Windows Application Textbox
Yes you are Right.. Is that possible???
 Originally Posted by formlesstree4
Okay, wait, so...you want to send SQL Server the word "Sonia" (IN ENGLISH), and expect it to translate it into the Hindi equivalent? Or am I misunderstanding you?
-
Oct 1st, 2013, 07:28 AM
#6
Re: Can we Type Hindi In Windows Application Textbox
 Originally Posted by sonia.sardana
Yes you are Right.. Is that possible???
Tell me, how would the server know to translate your text?
-
Oct 1st, 2013, 02:09 PM
#7
Thread Starter
Hyperactive Member
Re: Can we Type Hindi In Windows Application Textbox
 Originally Posted by formlesstree4
Tell me, how would the server know to translate your text?
OK. So we need to send hindi from .Net code too...
Is that possible suppose I type SONIA (ENGLISH) in textbox, it will convert to सोनिया in textbox, as we leave the textbox.
-
Oct 1st, 2013, 02:10 PM
#8
Thread Starter
Hyperactive Member
Re: Can we Type Hindi In Windows Application Textbox
 Originally Posted by formlesstree4
Tell me, how would the server know to translate your text?
OK. So we need to send hindi from .Net code too...
Is that possible suppose I type SONIA (ENGLISH) in textbox, it will convert to सोनिया in textbox, as we leave the textbox.
-
Oct 1st, 2013, 06:15 PM
#9
Re: Can we Type Hindi In Windows Application Textbox
 Originally Posted by sonia.sardana
OK. So we need to send hindi from .Net code too...
Is that possible suppose I type SONIA (ENGLISH) in textbox, it will convert to सोनिया in textbox, as we leave the textbox.
Sure. How would you convert it? Would you send a request to, say, Google Translate? I mean, is there a particular reason they can't be inserted in Hindi? I'm legitimately curious as I don't know.
-
Oct 2nd, 2013, 02:49 PM
#10
Thread Starter
Hyperactive Member
Re: Can we Type Hindi In Windows Application Textbox
 Originally Posted by formlesstree4
Sure. How would you convert it? Would you send a request to, say, Google Translate? I mean, is there a particular reason they can't be inserted in Hindi? I'm legitimately curious as I don't know.
I dont want to use Google Translate , because Internet Connection is Required while using Google Translate...
I want the string to be converted without using IE connection.
-
Oct 2nd, 2013, 03:41 PM
#11
Re: Can we Type Hindi In Windows Application Textbox
Converted and Translated are two completely different things.
Are you saying that SONIA - a 5 character word - is also 5 characters in Hindi - and that each character S, O, N, I and A map to particular characters in Hindi?
-
Oct 2nd, 2013, 03:44 PM
#12
Re: Can we Type Hindi In Windows Application Textbox
 Originally Posted by dunfiddlin
. This does mean that you've given yourself a bit of a problem if you're going to display the prefix 'N' in English and the remainder in Hindi of course because few controls give you the native ability to display more than one font at a time.
The N' prefix is asking SQL to use the DEFAULT CODE PAGE for the database to perform Unicode processing
http://databases.aspfaq.com/general/...-n-prefix.html
I would not imagine the N would appear in the text box - although this post seems otherworldly already
-
Oct 3rd, 2013, 08:54 AM
#13
Re: Can we Type Hindi In Windows Application Textbox
 Originally Posted by szlamany
As szl said, the N prefix to a string in T-SQL usually stands for either default code page or that the string is a Unicode string. It has no effect on the display when the text is returned, although you usually pair up the N prefix with an "NVARCHAR" or "NCHAR" [ even "NTEXT", but that's going away! ] data type.
Source: I use SQL all the time!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|