Khi import excel c# sqlserver thì gặp lỗi trên
Phương án: cài đặt accessdatabaseengine : https://www.microsoft.com/en-us/download/confirmation.aspx?id=54920;
Tiếp tục gặp lỗi :
Ad Hoc Distributed Queries
=> chạy lệnh: sp_configure 'show advanced options', 1; RECONFIGURE; GO sp_configure 'Ad Hoc Distributed Queries', 1; RECONFIGURE; GO
- LỖi tiếp;
Cannot create an instance of OLE DB provider "Microsoft.ACE.OLEDB.16.0" for linked server "(null)".
USE [master]
GO
EXEC master.dbo.sp_MSset_oledb_prop N'Microsoft.ACE.OLEDB.16.0', N'AllowInProcess', 1
GO
EXEC master.dbo.sp_MSset_oledb_prop N'Microsoft.ACE.OLEDB.16.0', N'DynamicParameters', 1
GO
Trường hợp Database và file không cùng 1 server thì cần phải map netword/share folder để file trên máy chủ chạy database.