Hi y.alim,
I have checked the code. Its working with arabic letter.
You need to add square bracket to the column name in the insert query.
Check this example. Now please take its reference and correct your code.
Import System.Data.OleDb namespace.
HTML
<asp:Label ID="Label1" runat="server" />
C#
protected void Page_Load(object sender, EventArgs e)
{
try
{
string connStr = @"provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\dharmendra\Desktop\Test.xls;Extended Properties=Excel 8.0;";
OleDbConnection MyConnection;
OleDbCommand MyCommand = new OleDbCommand();
MyConnection = new OleDbConnection(connStr);
MyConnection.Open();
MyCommand.Connection = MyConnection;
string sql = "Insert into [Sheet1$] ([هوية الزبون],[اسم],[بلد]) values('5','الهند','دارمندرا')";
MyCommand.CommandText = sql;
MyCommand.ExecuteNonQuery();
MyConnection.Close();
Label1.Text = "data inserted successfully !! ";
}
catch (Exception ex)
{
Label1.Text = ex.ToString();
}
}
VB.Net
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
Try
Dim connStr As String = "provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\dharmendra\Desktop\Test.xls;Extended Properties=Excel 8.0;"
Dim MyConnection As OleDbConnection
Dim MyCommand As New OleDbCommand()
MyConnection = New OleDbConnection(connStr)
MyConnection.Open()
MyCommand.Connection = MyConnection
Dim sql As String = "Insert into [Sheet1$] ([هوية الزبون],[اسم],[بلد]) values('5','الهند','دارمندرا')"
MyCommand.CommandText = sql
MyCommand.ExecuteNonQuery()
MyConnection.Close()
Label1.Text = "data inserted successfully !! "
Catch ex As Exception
Label1.Text = ex.ToString()
End Try
End Sub
Screenshots
Excel before Insert

Excel after Insert
