TDS Error on Azure Entity Framework SQL Calls after Windows 10 April 2018 Update [duplicate]
Asked Answered
L

1

3

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

Laraelaraine answered 15/5, 2018 at 15:51 Comment(0)
H
0

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://github.com/Microsoft/dotnet/issues/749

Hanser answered 16/5, 2018 at 17:22 Comment(2)
Setting MultipleActiveResultSets has resolved the issue for me. Thanks everyone.Laraelaraine
The temp solution doesn't work for meConcerning

© 2022 - 2024 — McMap. All rights reserved.