Closed ngvtien closed 4 years ago
@ngvtien the workaround breaks the drop-in replacement paradigm. GetTdsUserType
is missing the full context to work properly. It should probably be based on the output of GetTdsDataType
, not just the DbType
Actually, with the recent commit I've addressed this issue already, similar to to how we're dealing with UserType 34 and 35
Describe the bug If neither
UserType
36 nor 19 is set for when the byte count for the text value is greater than 16384 then we will get an exception thrownThe token datastream length was not correct. This is an internal protocol error.
To Reproduce Please provide C#/SQL necessary to reproduce the issue, and steps to follow: SQL:
C#
If you break into the code and set
UserType
for the 1st parameter to either 19 or 36 then it would work but not when 35 is setExpected behavior It shouldn't throw any exception.
Environment
AdoNetCore.AseClient
nuget package version 0.18.0Additional context One of the work-around for me at this stage is to allow AseParameter class to have an additional internal property to over write the user type and that can be set at the time when the parameter is created. eg something like this
and when it comes to creating the FormatItem we would check for any previous value set like so