You're looking at the wrong "provider". The one in the connection string is the OLEDB provider. You need to look at the
ProviderName
on the
ConnectionStringSettings
object.
Connection Strings and Configuration Files[
^]
='1.0'='utf-8'
<configuration>
<connectionStrings>
<add
name="Name"
providerName="System.Data.OleDb"
connectionString="Provider=SQLNCLI11.1;Integrated Security=false;Persist Security Info=False;User ID=XXX;Initial Catalog=DKOWare;Data Source=PC2014;Password=YYYY"
/>
</connectionStrings>
</configuration>
Dim settings As ConnectionStringSettings = ConfigurationManager.ConnectionStrings("Name")
Dim factory As DbProviderFactory = DbProviderFactories.GetFactory(settings.ProviderName)
Using connection As DbConnection = factory.CreateConnection()
connection.ConnectionString = settings.ConnectionString
...
End Using
NB: If you're using the
SqlClient
classes, you can remove the
Provider=SQLNCLI11.1;
key from your connection string, since those classes don't use the OLEDB provider.