CHRISTOS STAVRINOU
CHRISTOS STAVRINOU

Reputation: 1

SQLCommand Error on Visual Studio Designer (WinForms)

On a C# project (.NET Framework 4.8) when I try to create a control SqlCommand using the designer I get the following error

Failed to create component 'SqlCommand'. The error message follows: 'System.invalidCastException: Unable to cast object of type 'Microsoft.Data.SqlClient.SqlCommand' to type 'System.Data.SqlClient.SqlCommand'.

The same problem appears with Microsoft.Data.SqlClient V3 and V2.1.3 and older.

All other controls like SQLDataAdapter are ok.

Thanks in advance for any suggestions.enter image description here

Upvotes: -1

Views: 125

Answers (1)

Raj Shaw
Raj Shaw

Reputation: 51

Add Dependency "System.data.Common" in your project..

Upvotes: 0

Related Questions