且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何从FTP读取excel文件并在不下载的情况下加载到datatable中

更新时间:2023-09-10 20:33:52

你可能使用了错误的连接字符串。



对于XLSX文件:

Provider = Microsoft.ACE.OLEDB.12.0; Data Source =+ [filepath] +; Extended Properties = Excel 12.0;



对于XLS文件:

Provider = Microsoft.Jet.OLEDB。 4.0; &安培; 数据源=+ [文件路径] +;扩展属性=Excel 8.0; HDR = YES;
You're probably using the wrong connection string.

For XLSX files:
"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + [filepath] + ";Extended Properties=Excel 12.0";

For XLS files:
"Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" + [filepath] + ";Extended Properties="Excel 8.0;HDR=YES;"