Click here to Skip to main content
15,892,480 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello frnds i am trying to develop a dashboard where admin will type some content in hindi and this will insert in database in hindi but this not working as i have taken datatype nvarchar in sql server and have installed krutidev in my machine and also have set textbox font as Krutidev.

Doing this above i am getting to type in hindi in textbox but data is not inserted in hindi my sql query is "insert int mytable (hindinews) values(N'"+txt_hindi.Text+"')"



Plese help me
Posted

SQL
Create table Test_Lang

(strText nvarchar(max))


Insert into Test_Lang(strText) values(N'"+txt_hindi.Text+"')
 
Share this answer
 
v2
but I want to insert from textbox
 
Share this answer
 
Comments
Raajkumar.b 6-Nov-13 4:03am    
refer this link:
here i think you have to add GoogleLanguage.WebControls dll
http://googlelanguage.codeplex.com/
Try it working perfectly

aspx page:


XML
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ex.aspx.cs" Inherits="ex" %>



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
       <script src="https://www.google.com/jsapi" type="text/javascript">
    </script>
    <script type="text/javascript" language="javascript">
        google.load("elements", "1", {
            packages: "transliteration"
        });

        function onLoad() {
            var options = {
                sourceLanguage: google.elements.transliteration.LanguageCode.ENGLISH,
                destinationLanguage: [google.elements.transliteration.LanguageCode.HINDI],
                shortcutKey: 'ctrl+g',
                transliterationEnabled: true
            };

            var control = new google.elements.transliteration.TransliterationControl(options);
            control.makeTransliteratable(['TextBox3']);
            //TEXT1 is the id of the control which you will use for the transliteration.
        }
        google.setOnLoadCallback(onLoad);
    </script>
</head>
<body>
    <form id="form1" runat="server">

    <div>
        <div class="Google-transliterate-Way2blogging">
        <asp:TextBox ID="TextBox3" TextMode="MultiLine" Width="162px" Height="30px"
                runat="server"></asp:TextBox>
        <br />
        <br />


        <asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />
        <br />
        <br />
        <br />
        <br />
        </div>
    </div>
    </form>
</body>
</html>

aspx.cs:
C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;

public partial class ex : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
      
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        SqlConnection con = new SqlConnection("your connecting string");
        con.Open();
        SqlCommand cmd = new SqlCommand("Insert into Test_Lang(strText) values(N'"+TextBox3.Text+"')", con);
        cmd.ExecuteNonQuery();
        con.Close();
    }
    
}
 
Share this answer
 
v2

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