In a recent comment, I was told:
the default SQL Server client used to be
System.Data.SqlClient, but more recently there's alsoMicrosoft.Data.SqlClient- same thing conceptually, but packaged slightly differently and more up to date. It is largely up to you whether to useSystem.Data.SqlClientorMicrosoft.Data.SqlClient
Similarly, I recently tried to use a DSN connection string "DSN=MyDSNName" and this failed because I need to use an ODBC driver, not SqlServer - DSN isn't a property on SqlConnectionStringBuilder.
I was under the impression that .NET automatically chose the right driver based on my connection string but seemingly not.
How do I control this sort of stuff? Can .Net auto-detect the right provider to use from my connection-string, or must I hard-code in C# whether I want to use Odbc Vs SqlServer for instance?