While creating an ADO.NET Entity Data Model, following error occured:
Error 66 Argument 10: cannot convert from 'System.Data.Objects.ObjectParameter' to 'System.Data.Entity.Core.Objects.ObjectParameter' D:\Aziz\Aziz Project\Development\Running Development\Web\pos\pos\Model1.Context.cs 351 278 pos
How is it possible to solve this error?
using System.Data.Object;
using System.Data.Objects.DataClasses;
Replace for:
using System.Data.Entity.Core.Objects;
using System.Data.Entity.Core.Objects.DataClasses;
This is one of most frequent compile-time errors you may face in the Entity Framework. This occcurs when a
- Version conflict exists, or
- Namespace is used.
By default, while compiling your project, the framework includes the namespace using System.Data.Objects;
.
Solution:
To fix this issue:
- If the version conflicts, install the package for the respective version of the Entity Framework.
- If the version is the same, change the above namespace to
System.Data.Entity.Core.Objects
.