无法在 dotnet 核心实体框架中导入 OleDbConnection

Ami*_*rma 7 c# entity-framework oledbconnection .net-core

将数据从 excel 传输到 sqlserver 时无法在 dotnetcore 实体框架中导入 OleDbConnection

Vah*_*id 7

OleDb 现在可用于 .NET Core。 System.Data.OleDb在 NuGet.org 上可用

  • 是的,它可用于 .NET Core...但是...Visual studio (2022):警告 CA1416 - 此调用站点可在所有平台上访问。“OleDbConnection.Open()”仅在“windows”上受支持。-- Debian 11、dotnet 6.0:System.PlatformNotSupportedException:此平台不支持 System.Data.OleDb。 (3认同)

ric*_*sch 6

OleDb 在 .NET Core 中不可用,可能是因为它不是跨平台的。

查看.NET Core 2.0中的System.Data.OleDb 命名空间

替代方案
对于一个体面的替代方案,请查看此堆栈溢出问题的答案:How to get OleDb for reading excel in asp.net core project