Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

unable to import OleDbConnection in dotnet core entity framework

unable to import OleDbConnection in dotnetcore entity framework while transferring data from excel to sqlserver

like image 801
Amit Verma Avatar asked Apr 24 '18 05:04

Amit Verma


People also ask

Why is OLEDB not available in NET Core?

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.

How to get DotNet EF in NET Core?

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

How do I use oledbconnection in SQL Server?

OleDbCommand command = new OleDbCommand(insertSQL); // Set the Connection to the new OleDbConnection. command.Connection = connection; // Open the connection and execute the insert command.

Do I have to enable connection pooling with OLE DB?

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.


2 Answers

OleDb is now available for .NET Core. System.Data.OleDb is available on NuGet.org

like image 60
Vahid Avatar answered Oct 24 '22 09:10

Vahid


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

like image 21
rickvdbosch Avatar answered Oct 24 '22 10:10

rickvdbosch