Jingfei Hu wrote:
> 
> I have a VS2010 project from one of my friends. The project contains a
> sqlite3 database file containing some tables and some views. According to
my
> friend, the database file is working properly with Visual Studio 2010 at
> that time. Also I can see the edmx file and generated code files from the
> VS2010 project. And I also find out it still uses provider
> System.Data.Sqlite instead of System.Data.Sqlite.EF6.
> 

What version of System.Data.SQLite is he using?  Recent versions should
default
to the System.Data.SQLite.EF6 provider.

> 
> And when I open the project with Visual studio 2013 and compile it, it has
a
> failure saying 'the provider System.Data.Sqlite has not been registered in
> app.config or machine.config'. To fix this, first I complete the following
> installations
> 

That error message makes sense.  The System.Data.SQLite.EF6 provider should
be
used when EF6 support is wanted.

> 
> Then open the edmx file with Xml editor and manually change the
> 'System.Data.Sqlite' to 'System.Data.Sqlite.EF6' and then compile it, the
> error message changes to be like 'Object not reference an instance'. After
> that I try another way, delete the existed edmx file (starting from
> scratch). When I use 'New ADO.Net Entity Model' wizard of VS2013 to create
a
> model in a new console project, everything appears fine, but actually not.
> One of the view I need heavily is not auto-generated with the below
warning
> message
> 

Using an EDMX generated with one version of Visual Studio with a different
version seems unlikely to work, at least from my personal experience.

> 
> warning 6013: The table/view 'main.xxx does not have a primary key defined
> and no valid primary key could be inferred. This table/view has been
> excluded. To use the entity, you will need to review your schema, add the
> correct keys, and uncomment it.
> 

If the table actually does have a primary key defined, maybe the EDMX from
the
other version of Visual Studio is incompatible?

--
Joe Mistachkin

Reply via email to