Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cannot convert from 'System.Data.Objects.ObjectParameter' to 'System.Data.Entity.Core.Objects.ObjectParameter'

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?

like image 514
Md. Azizul Hoque Avatar asked Jun 01 '15 13:06

Md. Azizul Hoque


2 Answers

using System.Data.Object;
using System.Data.Objects.DataClasses;

Replace for:

using System.Data.Entity.Core.Objects;
using System.Data.Entity.Core.Objects.DataClasses;
like image 176
Kenny Kanp Avatar answered Oct 08 '22 21:10

Kenny Kanp


This is one of most frequent compile-time errors you may face in the Entity Framework. This occcurs when a

  1. Version conflict exists, or
  2. 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.
like image 43
BSG Avatar answered Oct 08 '22 22:10

BSG