دوستان سلام
من میخوام کاربر بیاد یه فایل اکسل آپلود کنه رو سرور بعد اطلاعات فایل اکسلی که ارسال شده رو تو دیتابیس بریزم این کارو به صورت لوکال انجام دادم و کدم درست کار میکنه ولی آپلود که میکنم همچین اروری دارم :
The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.
کدم هم به صورت زیر خیلی دعاتون میکنم اگه مشکلمو حل کنید چون واقعا اسیرم کرده:
If FileUpload1.HasFile = True And FileUpload1.HasFile = True Then

FileUpload1.SaveAs(Server.MapPath("~/admin/upload/") & FileUpload1.FileName)





Dim strSql As String = ""
strSql = "INSERT INTO tblExcel (CustomerID, City) VALUES (@CustomerID, @City)"

'SQL Server Connection String
Dim cn As New SqlClient.SqlConnection
cn.ConnectionString = "Data Source=.......;"



cn.Open()

'Connection String to Excel Workbook
Dim excelConnectionString As String = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=~/admin/upload/" & FileUpload1.FileName & ";Extended Properties=""Excel 12.0;HDR=YES;"""

' Create Connection to Excel Workbook
Using connection As New System.Data.OleDb.OleDbConnection(excelConnectionS tring)

'List columns you need from the Excel file
Dim command As New System.Data.OleDb.OleDbCommand("Select [CustomerID],[City] FROM [Sheet1$]", connection)
connection.Open()

' Create DbDataReader to Data Worksheet
Using dr As System.Data.OleDb.OleDbDataReader = command.ExecuteReader()

If dr.HasRows() Then
While dr.Read()
Dim cmd As New SqlClient.SqlCommand
cmd.Connection = cn
cmd.CommandType = CommandType.Text
cmd.CommandText = strSql
cmd.Parameters.Add("@CustomerID", SqlDbType.VarChar).Value = Convert.ToString(dr.Item("CustomerID"))
cmd.Parameters.Add("@City", SqlDbType.VarChar).Value = Convert.ToString(dr.Item("City"))
cmd.ExecuteScalar()
End While
End If

End Using

End Using

cn.Close()
cn = Nothing
End If