dotnet: Windows 10 (1803) - SqlCient error after updating Windows - “The incoming tabular data stream (TDS) remote procedure call > (RPC) protocol stream is incorrect”
From @dotnetshadow on May 15, 2018 7:10
Hi there,
I found some of my queries are not working after updating to Windows 10 version 1803. I can confirm that the same code works on machines without this update.
The error I keep getting is this:
System.Data.Entity.Core.EntityCommandExecutionException: An error occurred while executing the command definition. See the inner exception for details. ---> System.Data.SqlClient.SqlException: The incoming tabular data stream (TDS) remote procedure call (RPC) protocol stream is incorrect. Parameter 2 (""): Data type 0x00 is unknown.
Interestingly if I make the query non async then everything seems to work. Has something changed since Windows 10?
Other users have also indicated having the same problem https://stackoverflow.com/questions/50340258/entity-framework-error-after-updating-windows-the-incoming-tabular-data-strea
Further technical details
EF version: 6.2 Database Provider: Azure SQL Server Operating system: Windows 10 (1803) - April 2018 update IDE: Visual Studio 2017 15.7
Copied from original issue: aspnet/EntityFramework6#537
About this issue
- Original URL
- State: open
- Created 6 years ago
- Reactions: 1
- Comments: 33 (6 by maintainers)
My name is Peter Carlin and I work in the SQL Server team. I first want to apologize for this incident and the impact on users of .NET Framework 4.7.2. I also would like to thank all those who reported the issue. I would like to explain what happened and how Microsoft is fixing it in more detail. The issues is due to improvements to the Always Encrypted functionality in SQL. These improvements expand the set of operations that can be done in Always Encrypted, however they are not yet ready for applications to use. These improvements involve changes to both SqlClient and SQL server side. We introduced an error in .NET Framework 4.7.2 such that in some circumstances (related to MARS) SqlClient incorrectly thinks the added functionality is in use and sends invalid requests to SQL. SQL rejects those with the error messages seen in this thread. This only happens if connected to a SQL server that has support for the added functionality as well. SQL DB is the first to get the latest SQL changes, and recently deployed the added functionality. Our immediate fix is to ensure the SQL DB acts as if it does not have the added functionality, so the SqlClient side bug in 4.7.2 is not encountered. This is why we are able to fix the issue with a SQL DB side change. At this point the fix has been deployed to all SQL DB servers.
An update from Azure SQL Engineering team: Engineers have developed a SQL DB server side fix and are rolling out through the safe deployment procedure. ETA 24-48 hours.
I can confirm that the issue seems to be resolved, thank you for all your efforts, great work
@demodav You should make others aware that the method you referenced as a solution is only available from a third-party package. It is not part of Entity Framework.
Yes, I was able to repro the issue. I’m investigating potential fixes.
I am still working on a simplified repro project, but I have found that if I change MultipleActiveResultSets from TRUE to FALSE in my connection string, the error stops.