In this article I will explain with an example, how to insert (save) Hindi, Marathi, Gujarati, Urdu, Persian, Arabic, Tamil and Telugu languages Text characters in SQL Server database using C# and VB.Net in ASP.Net.
In SQL Server database NVARCHAR data type will be used to store the various languages text characters.
 
 
Database
I have made use of the following table Languages with the schema as follows.
Content column is specified with NVARCHAR data type for saving Hindi, Marathi, Gujarati, Urdu, Persian, Arabic, Tamil and Telugu languages Text characters.
Insert Hindi, Marathi, Gujarati, Urdu, Persian, Arabic, Tamil and Telugu languages Text characters in SQL Server using C# and VB.Net
 
Note: You can download the database table SQL by clicking the download link below.
         Download SQL file
 
 
HTML Markup
The following HTML Markup consists of an ASP.Net GridView and a Button.
The Button has been assigned an OnClick event handler.
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false">
    <Columns>
        <asp:BoundField DataField="Language" HeaderText="Language" />
        <asp:BoundField DataField="Content" HeaderText="Content" />
    </Columns>
</asp:GridView>
<br />
<asp:Button Text="Save" runat="server" OnClick="Save" />
 
 
Namespaces
You will need to import the following namespaces.
C#
using System.Data;
using System.Configuration;
using System.Data.SqlClient;
 
VB.Net
Imports System.Data
Imports System.Configuration
Imports System.Data.SqlClient
 
 
Binding the GridView
Inside the Page Load event handler, the GridView is populated using dynamic temporary DataTable object.
Note: For more information on this technique please refer my article: Create DataTable dynamically and bind to GridView in ASP.Net.
 
C#
protected void Page_Load(object sender, EventArgs e)
{
    DataTable dt = new DataTable();
    dt.Columns.AddRange(new DataColumn[2] { new DataColumn("Language"), new DataColumn("Content") });
    dt.Rows.Add("English""World is beautiful.");
    dt.Rows.Add("Hindi""दुनियासुंदरहै।");
    dt.Rows.Add("Marathi""जगसुंदरआहे.");
    dt.Rows.Add("Gujarati""વિશ્વસુંદરછે.");
    dt.Rows.Add("Urdu""دنیا خوبصورت ہے.");
    dt.Rows.Add("Persian""جهانی زیبا است.");
    dt.Rows.Add("Arabic""العالم هو جميل.");
    dt.Rows.Add("Tamil""உலகஅழகாகஇருக்கிறது.");
    dt.Rows.Add("Telugu""ప్రపంచఅందమైనఉంది.");
    GridView1.DataSource = dt;
    GridView1.DataBind();
}
 
VB.Net
Protected Sub Page_Load(sender As Object, e As EventArgsHandles Me.Load
    Dim dt As New DataTable()
    dt.Columns.AddRange(New DataColumn(1) {New DataColumn("Language"), New DataColumn("Content")})
    dt.Rows.Add("English""World is beautiful.")
    dt.Rows.Add("Hindi""दुनियासुंदरहै।")
    dt.Rows.Add("Marathi""जगसुंदरआहे.")
    dt.Rows.Add("Gujarati""વિશ્વસુંદરછે.")
    dt.Rows.Add("Urdu""دنیا خوبصورت ہے.")
    dt.Rows.Add("Persian""جهانی زیبا است.")
    dt.Rows.Add("Arabic""العالم هو جميل.")
    dt.Rows.Add("Tamil""உலகஅழகாகஇருக்கிறது.")
    dt.Rows.Add("Telugu""ప్రపంచఅందమైనఉంది.")
    GridView1.DataSource = dt
    GridView1.DataBind()
End Sub
 
 
Inserting (Saving) Hindi, Marathi, Gujarati, Urdu, Persian, Arabic, Tamil and Telugu languages Text characters in SQL Server
The following event handler is executed when the Save button is clicked.
Inside this event handler a loop is executed over the GridView Rows and one by one each Language and Content is inserted into the SQL Server database table.
C#
protected void Save(object sender, EventArgs e)
{
    string constr = ConfigurationManager.ConnectionStrings["constr"].ConnectionString;
    using (SqlConnection con = new SqlConnection(constr))
    {
        foreach (GridViewRow row in GridView1.Rows)
        {
            using (SqlCommand cmd = new SqlCommand("INSERT INTO Languages VALUES(@Language, @Content)", con))
            {
                cmd.Parameters.AddWithValue("@Language", row.Cells[0].Text);
                cmd.Parameters.AddWithValue("@Content", row.Cells[1].Text);
                con.Open();
                cmd.ExecuteNonQuery();
                con.Close();
            }
        }
    }
}
 
VB.Net
Protected Sub Save(sender As Object, e As EventArgs)
    Dim constr As String = ConfigurationManager.ConnectionStrings("constr").ConnectionString
    Using con As New SqlConnection(constr)
        For Each row As GridViewRow In GridView1.Rows
            Using cmd As New SqlCommand("INSERT INTO Languages VALUES(@Language, @Content)", con)
                cmd.Parameters.AddWithValue("@Language", row.Cells(0).Text)
                cmd.Parameters.AddWithValue("@Content", row.Cells(1).Text)
                con.Open()
                cmd.ExecuteNonQuery()
                con.Close()
            End Using
        Next
    End Using
End Sub
 
 
Screenshots
The GridView
Insert Hindi, Marathi, Gujarati, Urdu, Persian, Arabic, Tamil and Telugu languages Text characters in SQL Server using C# and VB.Net
 
The inserted records in the database table
Insert Hindi, Marathi, Gujarati, Urdu, Persian, Arabic, Tamil and Telugu languages Text characters in SQL Server using C# and VB.Net
 
 
Downloads