dharmendr says:
Will you please share the code and let me know the problem?
Its working now the problem was in name of sheet
i was write sheet1$ and the correct is Table$
Dim connStr As String = "provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\1myex.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 [Table1$] ([الوظيفة],[التليفون],[العنوان],الأسم]) values('محمد','المهندسن','1236521',مدير مشروع')"
MyCommand.CommandText = sql
MyCommand.ExecuteNonQuery()
MyConnection.Close()
Label1.Text = "data inserted successfully !! "
Catch ex As Exception
Label1.Text = ex.ToString()
End Try
i will replace values with paramters and use addwithvalue in command