We are getting exception while consuming Interop.SQLXMLBULKLOADLib.dll library to bulk upload the data in C# Application with .NET 4.7 Framework.
Details of library used for bulk upload:
Interop.SQLXMLBULKLOADLib.DLL
RunTime version: v1.1.4322
Version: 4.0.0.0
Following method we are calling to do the upload operation:
public virtual extern void Execute(string bstrSchemaFile, object vDataFile)
Note: We are using provider as "MSOLEDBSQL" while forming SQL connection string.
The Error we are getting from the server:
System.Runtime.InteropServices.COMException (0x80004005): Error connecting to the data source.
at SQLXMLBULKLOADLib.SQLXMLBulkLoad4Class.Execute(String bstrSchemaFile, Object vDataFile)
Environment Details:
Windows 2016
SQL verion - 2016 Service Pack 2
TLS 1.2 is enabled on Windows
Following are the steps to enable TLS 1.2 on the windows server.
a. Disable TLS 1.0 and 1.1 - Best Crypto Security Win 2016, 2019 rev 4
b. Disables TLS 1.0 and 1.1 (enables 1.2) for the Windows OS
c. Makes .NET Framework compatible with TLS 1.2
d. Configures the WINHTTP protocol to disable TLS 1.0 and 1.1 (enables 1.2)
e. Disables TLS 1.0 and 1.1 in Google Chrome, Microsoft Edge Chromium and Internet Explorer. (Internet Explorer is also dependent on the Windows OS TLS configuration, the Chromium browsers are not.)
f. Forces .NET Framework to use Strong Crypto
g. Disables RC4 crypto for the Windows OS
h. Disables Triple DES crypto for the Windows OS
i. Disables DES crypto for the Windows OS
j. Configures DHE (Diffie-Hellman) TLS to use 2048 bit key exchange to close two iPost vulnerabilities.
k. Forces the Windows OS to enforce FIPS 140-2 compliance for crypto.
l. Defines what ciphers suites are enabled and the order of the cipher suites for the TLS handshake. THIS VERSION DISABLES MORE WEAK CIPHERS THAN THE “Good Crypto” version. This version is for 2016 and 2019 and is not compatible with earlier versions of Windows Server.