Wednesday, August 25, 2021

Released: Microsoft.Data.SqlClient 4.0 Preview 1

Microsoft.Data.SqlClient 4.0 Preview 1 has been released. This release contains improvements and updates to the Microsoft.Data.SqlClient data provider for SQL Server.

Our plan is to provide GA releases twice a year with two preview releases in between. This cadence should provide time for feedback and allow us to deliver features and fixes in a timely manner. This first 4.0 preview includes many fixes and changes over the previous 3.0 GA release.

 

Notable changes include:

  • Encrypt default value set to true

    The default value of the Encrypt connection setting has been changed from false to true. With the growing use of cloud databases and the need to ensure those connections are secure, it's time for this backwards-compatibility-breaking change.

  • Ensure connections fail when encryption is required

    In scenarios where client encryption libraries were disabled or unavailable, it was possible for unencrypted connections to be made when Encrypt was set to true or the server required encryption.

  • App Context Switch for using System default protocols

    TLS 1.3 is not supported by the driver; therefore, it has been removed from the supported protocols list by default. Users can switch back to forcing use of Operating System's client protocols, by enabling the App Context switch below:

    Switch.Microsoft.Data.SqlClient.UseSystemDefaultSecureProtocols

  • Enable optimized parameter binding

    Microsoft.Data.SqlClient introduces new SqlCommand API, EnableOptimizedParameterBinding to improve performance of queries with large number of parameters. This property is disabled by default. When set to true, parameter names will not be sent to the SQL server when the command is executed.

    public class SqlCommand
    {
    	public bool EnableOptimizedParameterBinding { get; set; }
    }

 

For the full list of changes in Microsoft.Data.SqlClient 4.0 Preview 1, please see the Release Notes.

 

To try out the new package, add a NuGet reference to Microsoft.Data.SqlClient in your application and pick the 4.0 preview 1 version.

 

We appreciate the time and effort you spend checking out our previews. It makes the final product that much better. If you encounter any issues or have any feedback, head over to the SqlClient GitHub repository and submit an issue.

 

David Engel

Posted at https://sl.advdat.com/3DjjsiX