更新时间:2023-01-21 23:27:47
Try below link
OLEDB Provider is Not Registered on the Local Machine[^]
Yes, I guess you need to add the reference to your server. Here is the useful links that may helps you:
import excel data to sql server database table and display in gridview[^]
http://***.com/questions/21673283/import-excel-data-to-sql-server-database-table-and-display-in-gridview[^]
So, I think Epplus.dll is the best way to import excel data to datatable.
http://www.aspneto.com/import-csv-excel-data-into-sql-server-using-bulk-insert-asp-net.html[^]
Thank you for all your suggestions! I used this. However, it just accepts Excel in 2003 formatOleDbConnection oconn = new OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + path + ";Extended Properties='Excel 12.0;HDR=YES;IMEX=1';");