You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to add a System.Data.SqlClient.SqlParameter to a Microsoft.Data.SqlClient.SqlParameterCollection gives this error message:
The SqlParameterCollection only accepts non-null SqlParameter type objects, not SqlParameter objects.
This mistake can come up when migrating to the new driver or when using the new driver for ADO.NET Code and the old driver when working with EF6. If you're aware of the situation and history of the two drivers it is easy to intuit what this message means, but for the uninitiated this can be pretty confusing.
Describe the bug
Trying to add a
System.Data.SqlClient.SqlParameter
to aMicrosoft.Data.SqlClient.SqlParameterCollection
gives this error message:This mistake can come up when migrating to the new driver or when using the new driver for ADO.NET Code and the old driver when working with EF6. If you're aware of the situation and history of the two drivers it is easy to intuit what this message means, but for the uninitiated this can be pretty confusing.
To reproduce
Expected behavior
A message like the following would be more clear:
This seems trivial to fix; just changing
SqlClient/src/Microsoft.Data.SqlClient/src/Microsoft/Data/Common/AdapterUtil.cs
Line 787 in 865ac03
Type.ToString()/Type.FullName
instead ofType.Name
for the expected and actual types. I'd be happy to submit a PR if there is interest.Further technical details
Microsoft.Data.SqlClient version: 4.1.0
.NET target: net5.0
SQL Server version: n/a
Operating system: Windows 10
The text was updated successfully, but these errors were encountered: