Results 1 to 13 of 13

Thread: Can we Type Hindi In Windows Application Textbox

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2008
    Posts
    474

    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!!!

  2. #2
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,245

    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!

  3. #3
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,424

    Re: Can we Type Hindi In Windows Application Textbox

    Quote Originally Posted by dunfiddlin View Post
    ...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

  4. #4

    Re: Can we Type Hindi In Windows Application Textbox

    Quote Originally Posted by sonia.sardana View Post
    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?

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2008
    Posts
    474

    Re: Can we Type Hindi In Windows Application Textbox

    Yes you are Right.. Is that possible???
    Quote Originally Posted by formlesstree4 View Post
    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?

  6. #6

    Re: Can we Type Hindi In Windows Application Textbox

    Quote Originally Posted by sonia.sardana View Post
    Yes you are Right.. Is that possible???
    Tell me, how would the server know to translate your text?

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2008
    Posts
    474

    Re: Can we Type Hindi In Windows Application Textbox

    Quote Originally Posted by formlesstree4 View Post
    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.

  8. #8

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2008
    Posts
    474

    Re: Can we Type Hindi In Windows Application Textbox

    Quote Originally Posted by formlesstree4 View Post
    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.

  9. #9

    Re: Can we Type Hindi In Windows Application Textbox

    Quote Originally Posted by sonia.sardana View Post
    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.

  10. #10

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2008
    Posts
    474

    Re: Can we Type Hindi In Windows Application Textbox

    Quote Originally Posted by formlesstree4 View Post
    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.

  11. #11
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    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?

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  12. #12
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: Can we Type Hindi In Windows Application Textbox

    Quote Originally Posted by dunfiddlin View Post
    . 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

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  13. #13

    Re: Can we Type Hindi In Windows Application Textbox

    Quote Originally Posted by szlamany View Post
    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
    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
  •  



Click Here to Expand Forum to Full Width