I have the following C# code that executes against a SQL Server hosted in Azure.
protected IQueryable<T> FilterUpdatedRows<T>(IQueryable<T> query, DateTime lastSyncTimestamp) where T: class, ITimestamp
{
return query.Where(x => x.InsertTimestamp >= lastSyncTimestamp ||
(x.UpdateTimestamp.HasValue && x.UpdateTimestamp >= lastSyncTimestamp));
}
The Generic (T) are Entity Framework context classes that implement and interface that forces the InsertTimestamp and UpdateTimestamp to be defined.
This code has worked fine until I installed the April 2018 Update of Windows 10. Post update I get the following error ...
SqlException: The incoming tabular data stream (TDS) remote procedure call (RPC) protocol stream is incorrect. Parameter 2 (""): Data type 0x00 is unknown.
I confirmed that the parameters causing the issue are the InsertTimestamp and UpdateTimestamp fields.
This error only happens when I am targeting my copy of the SQL database on Azure. Exporting the database to a local database works without issue. Team members who have not upgraded to the April 2018 update have no issue when hitting the Azure version.
I ran a SQL Trace on my local version and captured the executing SQL statement. Running that statement through SSMS against the Azure version works without issue.
Here is the SQL statement captured by the trace ...
exec sp_executesql N'SELECT
[Extent1].[CrossingId] AS [CrossingId],
... Misc other fields ...
[Extent1].[CrossingInstanceId] AS [CrossingInstanceId]
FROM (SELECT
[V_SYNC_CrossingsSync].[CrossingId] AS [CrossingId],
... Misc other fields ...
[V_SYNC_CrossingsSync].[CrossingInstanceId] AS [CrossingInstanceId]
FROM [dbo].[V_SYNC_CrossingsSync] AS [V_SYNC_CrossingsSync]) AS [Extent1]
WHERE ([Extent1].[InsertTimestamp] >= @p__linq__0) OR (([Extent1].[UpdateTimestamp] IS NOT NULL) AND ([Extent1].[UpdateTimestamp] >= @p__linq__1))',N'@p__linq__0 datetime2(7),@p__linq__1 datetime2(7)',@p__linq__0='1980-01-01 00:00:00',@p__linq__1='1980-01-01 00:00:00'
Any thoughts on what may be going on?
Thanks
Temp Workaround: Per ChainbridgeTech change MultipleActiveResultSets from TRUE to FALSE in my connection string, and the error stops.
This has been reported and is being worked on. They still need a repro and I'm still working on isolating shareable data that I can make public:
来源:https://stackoverflow.com/questions/50354456/tds-error-on-azure-entity-framework-sql-calls-after-windows-10-april-2018-update