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

耗尽温柔 提交于 2019-12-07 17:29:41

问题


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


回答1:


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



来源:https://stackoverflow.com/questions/50354456/tds-error-on-azure-entity-framework-sql-calls-after-windows-10-april-2018-update

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!