Released: Microsoft.Data.SqlClient 4.0 Preview 1

Published Aug 25 2021 01:56 PM 2,232 Views
Senior Member

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

%3CLINGO-SUB%20id%3D%22lingo-sub-2685322%22%20slang%3D%22en-US%22%3EReleased%3A%20Microsoft.Data.SqlClient%204.0%20Preview%201%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2685322%22%20slang%3D%22en-US%22%3E%3CP%3EMicrosoft.Data.SqlClient%204.0%20Preview%201%20has%20been%20released.%20This%20release%20contains%20improvements%20and%20updates%20to%20the%20Microsoft.Data.SqlClient%20data%20provider%20for%20SQL%20Server.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-family%3A%20inherit%3B%22%3EOur%20plan%20is%20to%20provide%20GA%20releases%20twice%20a%20year%20with%20two%20preview%20releases%20in%20between.%20This%20cadence%20should%20provide%20time%20for%20feedback%20and%20allow%20us%20to%20deliver%20features%20and%20fixes%20in%20a%20timely%20manner.%20This%20first%204.0%20preview%20includes%20many%20fixes%20and%20changes%20over%20the%20previous%203.0%20GA%20release.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ENotable%20changes%20include%3A%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CSTRONG%3EEncrypt%20default%20value%20set%20to%20true%3C%2FSTRONG%3E%3CP%3EThe%20default%20value%20of%20the%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CCODE%3EEncrypt%3C%2FCODE%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Econnection%20setting%20has%20been%20changed%20from%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CCODE%3Efalse%3C%2FCODE%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Eto%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CCODE%3Etrue%3C%2FCODE%3E.%20With%20the%20growing%20use%20of%20cloud%20databases%20and%20the%20need%20to%20ensure%20those%20connections%20are%20secure%2C%20it's%20time%20for%20this%20backwards-compatibility-breaking%20change.%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%3CSTRONG%3EEnsure%20connections%20fail%20when%20encryption%20is%20required%3C%2FSTRONG%3E%3CP%3EIn%20scenarios%20where%20client%20encryption%20libraries%20were%20disabled%20or%20unavailable%2C%20it%20was%20possible%20for%20unencrypted%20connections%20to%20be%20made%20when%20Encrypt%20was%20set%20to%20true%20or%20the%20server%20required%20encryption.%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%3CSTRONG%3EApp%20Context%20Switch%20for%20using%20System%20default%20protocols%3C%2FSTRONG%3E%3CP%3ETLS%201.3%20is%20not%20supported%20by%20the%20driver%3B%20therefore%2C%20it%20has%20been%20removed%20from%20the%20supported%20protocols%20list%20by%20default.%20Users%20can%20switch%20back%20to%20forcing%20use%20of%20Operating%20System's%20client%20protocols%2C%20by%20enabling%20the%20App%20Context%20switch%20below%3A%3C%2FP%3E%0A%3CP%3E%3CCODE%3ESwitch.Microsoft.Data.SqlClient.UseSystemDefaultSecureProtocols%3C%2FCODE%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%3CSTRONG%3EEnable%20optimized%20parameter%20binding%3C%2FSTRONG%3E%3CP%3EMicrosoft.Data.SqlClient%20introduces%20new%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CCODE%3ESqlCommand%3C%2FCODE%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3EAPI%2C%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CCODE%3EEnableOptimizedParameterBinding%3C%2FCODE%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Eto%20improve%20performance%20of%20queries%20with%20large%20number%20of%20parameters.%20This%20property%20is%20disabled%20by%20default.%20When%20set%20to%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CCODE%3Etrue%3C%2FCODE%3E%2C%20parameter%20names%20will%20not%20be%20sent%20to%20the%20SQL%20server%20when%20the%20command%20is%20executed.%3C%2FP%3E%0A%3CDIV%20class%3D%22highlight%20highlight-source-cs%20position-relative%22%3E%0A%3CPRE%3E%3CSPAN%20class%3D%22pl-k%22%3Epublic%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22pl-k%22%3Eclass%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22pl-en%22%3ESqlCommand%3C%2FSPAN%3E%0A%7B%0A%20%3CSPAN%20class%3D%22pl-k%22%3Epublic%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22pl-k%22%3Ebool%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22pl-en%22%3EEnableOptimizedParameterBinding%3C%2FSPAN%3E%20%7B%20%3CSPAN%20class%3D%22pl-k%22%3Eget%3C%2FSPAN%3E%3B%20%3CSPAN%20class%3D%22pl-k%22%3Eset%3C%2FSPAN%3E%3B%20%7D%0A%7D%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFor%20the%20full%20list%20of%20changes%20in%20Microsoft.Data.SqlClient%204.0%20Preview%201%2C%20please%20see%20the%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fdotnet%2FSqlClient%2Fblob%2Fmain%2Frelease-notes%2F4.0%2F4.0.0-preview1.md%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3ERelease%20Notes%3C%2FA%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ETo%20try%20out%20the%20new%20package%2C%20add%20a%20%3CA%20href%3D%22https%3A%2F%2Fwww.nuget.org%2Fpackages%2FMicrosoft.Data.SqlClient%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3ENuGet%20reference%20to%20Microsoft.Data.SqlClient%3C%2FA%3E%26nbsp%3Bin%20your%20application%20and%20pick%20the%204.0%20preview%201%20version.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWe%20appreciate%20the%20time%20and%20effort%20you%20spend%20checking%20out%20our%20previews.%20It%20makes%20the%20final%20product%20that%20much%20better.%20If%20you%20encounter%20any%20issues%20or%20have%20any%20feedback%2C%20head%20over%20to%20the%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fdotnet%2FSqlClient%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3ESqlClient%20GitHub%20repository%3C%2FA%3E%20and%20submit%20an%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fdotnet%2FSqlClient%2Fissues%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3Eissue%3C%2FA%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EDavid%20Engel%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-2685322%22%20slang%3D%22en-US%22%3E%3CP%3EMicrosoft.Data.SqlClient%204.0%20Preview%201%20has%20been%20released.%20This%20release%20contains%20improvements%20and%20updates%20to%20the%20Microsoft.Data.SqlClient%20data%20provider%20for%20SQL%20Server.%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2685322%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ESQLServerDrivers%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Co-Authors
Version history
Last update:
‎Aug 25 2021 01:56 PM
Updated by: