In the image below it is possible to see two projects (Visual Studio 2017 v15.9.6):
-GeneralFunctions is a .NET Standard 2.0
-TestFramework is a .NET Framework 4.6.1
My idea is to develop some functions in the .NET Std project and access them from the .NET Framework. I've struggled to be able to make "System.Data.SqlClient.SqlConnection" and "System.Data.Odbc.OdbcConnection" working. Answer here.
Now I would like to implement "System.Data.OleDb.OleDbConnection" but I cannot find the NuGet pack for it.
Dim connection As IDbConnection
connection = New System.Data.SqlClient.SqlConnection("")
connection = New System.Data.Odbc.OdbcConnection("")
connection = New System.Data.OleDb.OleDbConnection("")
The Error for the OleDB is: Error BC30002 Type 'System.Data.OleDb.OleDbConnection' is not defined.
The reason it does not work is OLE is a platform specific technology for windows. You can not use OLE on platforms that are not windows.
For that reason Microsoft did not create a .NET Standard System.Data.OleDb
NuGet package, you will need to create the Ole connection in a full .net framework library and have it passed in as a IDbConnection
in to your .NET Standard code.
You can see here the list of frameworks that do support Ole Db
UPDATE: (copied from a decent answer by Peter that was deleted by a moderator)
MS published a NuGet package for OleDb two weeks ago: https://www.nuget.org/packages/System.Data.OleDb/