zzzprojects / Dapper-Plus

Dapper Plus - High-Efficient Bulk Actions (Insert, Update, Delete, and Merge) for .NET
https://dapper-plus.net/
383 stars 85 forks source link

Oracle Client - The Provider could not be resolved. You must explicitly set the Provider. #71

Closed vteixeira87 closed 3 years ago

vteixeira87 commented 3 years ago

I'm trying to test the library and I'm taking this error when running BulkInsert.

Follow my code

private OracleConnection _conn;

        public OcupacaoDb()
        {
            if (_conn != null) return;

            var strConnection = ConfigurationManager.ConnectionStrings["Oracle"].ConnectionString;

            _conn = new OracleConnection { ConnectionString = strConnection };

            if (_conn.State == ConnectionState.Closed)
                _conn.Open();
        }

  using (var bulk = new BulkOperation<OcupacaoOracle>(_conn))
                {
                    // easy to use
                    bulk.DestinationTableName = "Ocupacao";

                    bulk.BulkInsert(ocupacaoList);
                }
JonathanMagnan commented 3 years ago

Hello @vteixeira87 ,

Could you let us know exactly which Oracle package you are using?

Our library supports Oracle, so we are not sure yet why you are getting this error.

Best Regards,

Jon

vteixeira87 commented 3 years ago

Hello

I'm using System.Data.OracleClient

I didn't see if there is any place to map between the DTO and the table, but my Dto has the same properties as the table and their names are the same too.

JonathanMagnan commented 3 years ago

Hello @vteixeira87 ,

Is there a reason why you currently use a custom package: https://www.nuget.org/packages/System.Data.OracleClient/ instead of the official one? https://www.nuget.org/packages/Oracle.ManagedDataAccess/

From what it looks, the package you are currently using is no longer supported.

vteixeira87 commented 3 years ago

I'm on a legacy project and it is quite extensive, the exchange of packages is unviable at the moment, unfortunately.

But the package serves us well, in all necessary operations.

vteixeira87 commented 3 years ago

Actually what we use is this

https://docs.microsoft.com/en-us/dotnet/api/system.data.oracleclient?view=dotnet-plat-ext-3.1

JonathanMagnan commented 3 years ago

Unfortunately, we already discussed in the past about not supporting the package made by Microsoft since even themselves don't longer support it.

So, unfortunately, It will not be possible to use our library with this legacy package.

vteixeira87 commented 3 years ago

Okay, thank you so much for returning