I am using .NET framework 4.6.1 in a F# project. In earlier version, I could use a SqlCommandProvider
which would call a stored procedure (which accepts a table-valued parameter). But recently it is showing an error:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
System.InvalidCastException: Unable to cast object of type 'System.Object[]' to type 'Microsoft.SqlServer.Server.SqlDataRecord'.
at System.Linq.Enumerable.d__97`1.MoveNext()
The code has not been changed, just the .NET version or F# runtime version. I guess, the method cannot convert my table-value args to required SQL type. I have also tried SqlProgrammabilityProvider
with no luck.
Any suggestion?