Hi all,
First I need your instructions about how to reply a daily digest email
because if I reply it directly, it seems the email carries a lot of topics
which doesn't belong to me and also it would bother others. And it's not
very easy for me to locate my topic if there are many and reply it
accordingly. BTW, I don't receive an independent reply for the topic of
myself. Only digest email is received. Is it because I choose to? Anyway I
only leave the message I want here and comment in line. Thanks.

------------------------------

Message: 4
Date: Sun, 19 Apr 2015 17:22:06 -0700
From: "Joe Mistachkin" <sql...@mistachkin.com>
To: "'General Discussion of SQLite Database'"
        <sqlite-users at mailinglists.sqlite.org>
Subject: Re: [sqlite] System.Data.Sqlite with EF6 and VS2013 not
        working with asqlite database file
Message-ID: <16CD11762DDC441E9DAFF33904AE7DC7 at LACHRYMOSE>
Content-Type: text/plain;       charset="us-ascii"


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.
Jingfei: The version information has been lost because my friend is not an
IT guy. And the project, you know, has been through a lot transitions. Apart
from that, which version does it start from that the Sytem.Data.SQLite use
System.Data.SQLite.EF6 provider as the default? I download a
sqlite-netFx40-setup-bundle-x86-2010-1.0.82.0 from another website because
this system.data.sqlite.org doesn't maintain the old version. And that
version still uses System.Data.SQLite as the default. 
> 
> 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?

Jingfei: No, the view doesn't have a primary key defined. I recheck the
schema using sqlite console tool and it doesn't have.  However, in Visual
Studio 2010, it can infer a primary key for the view from the database file.
So I wonder whether it's the version of VS or the version of
System.Data.Sqlite that causes this difference.

--
Joe Mistachkin

Reply via email to