unable to import OleDbConnection in dotnetcore entity framework while transferring data from excel to sqlserver
OleDb is not available in .NET Core, probably because it's not cross platform. Have a look at the System.Data.OleDb Namespace in .NET Core 2.0.
Get the .NET Core CLI tools 1 dotnet ef must be installed as a global or local tool. ... 2 To update the tools, use the dotnet tool update command. 3 Install the latest Microsoft.EntityFrameworkCore.Design package. .NET CLI dotnet add package Microsoft.EntityFrameworkCore.Design
OleDbCommand command = new OleDbCommand(insertSQL); // Set the Connection to the new OleDbConnection. command.Connection = connection; // Open the connection and execute the insert command.
When you use the .NET Framework Data Provider for OLE DB, you do not have to enable connection pooling because the provider manages this automatically. For more information about how to use connection pooling with the .NET Framework Data Provider for OLE DB, see OLE DB, ODBC, and Oracle Connection Pooling.
OleDb is now available for .NET Core. System.Data.OleDb is available on NuGet.org
OleDb is not available in .NET Core, probably because it's not cross platform.
Have a look at the System.Data.OleDb Namespace in .NET Core 2.0.
Alternative
For a decent alternative, have a look at the answer to this Stack Overflow question: How to get OleDb for reading excel in asp.net core project
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With