Re: [sqlite] Entity framework design-time has stopped working in latestversions.

2013-05-04 Thread David Richardson
Hi Joe,

Thanks for the speedy reply. I checked the thread and I'm not sure that there 
are related. The easiest way to replicate my issue is to have a sqlite DB (for 
example with two tables with a foreign key) and try to generate entity data 
model from it. I wont generate the model no matter what.

kind regards,

David Richardson



 From: Joe Mistachkin <sql...@mistachkin.com>
To: 'General Discussion of SQLite Database' <sqlite-users@sqlite.org> 
Cc: 'David Richardson' <daviric...@yahoo.com> 
Sent: Saturday, May 4, 2013 11:26 PM
Subject: RE: [sqlite] Entity framework design-time has stopped working in 
latestversions.
 


David Richardson wrote:
>
> I don't know why but the latest versions [Setups for 32-bit Windows
> (.NET Framework 4.0) 1.0.84 and 1.0.85] does not generate a model in
> Entity Framework (4.1). I had to rollback to 1.0.83 and it was working
> again. I was getting exceptions in my code (null values). After some
> testing I realized it was this upgrade. 
> 
> Is this a bug? Has anybody else experience this issue? Are there
> workarounds for this problem?
>

I believe what you are seeing is this issue (which has been fixed in
trunk and will be part of the upcoming release):

    https://system.data.sqlite.org/index.html/info/49e30d7612

--
Joe Mistachkin
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Entity framework design-time has stopped working in latest versions.

2013-05-04 Thread David Richardson
Hi,

specifications:

Windows 7 64-bit
Visual Studio 2010 SP1
Entity framework 4.1

I don't know why but the latest versions [Setups for 32-bit Windows (.NET 
Framework 4.0) 1.0.84 and 1.0.85] does not generate a model in Entity Framework 
(4.1). I had to rollback to 1.0.83 and it was working again. I was getting 
exceptions in my code (null values). After some testing I realized it was this 
upgrade. 

Is this a bug? Has anybody else experience this issue? Are there workarounds 
for this problem?

kind regards,

David Richardson
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] PRAGMA foreign_keys = ?, feature request

2012-12-23 Thread David Richardson
Hi Larry,

I think I had similar problem once. 

Here was the solution I found for it:


http://www.mail-archive.com/sqlite-users@sqlite.org/msg73131.html


HTH,

David Richardson


 From: Larry Brasfield <brasfield.la...@gmail.com>
To: SQLite Users mailing list <sqlite-users@sqlite.org> 
Sent: Monday, December 24, 2012 2:20 AM
Subject: [sqlite] PRAGMA foreign_keys = ?, feature request
 
I have a situation here that I expect will apply to others as Microsoft's 
"Entity Framework" is used with System.Data.SQLite .

The framework opens and closes the database, presumably like it treats other DB 
connections.  The schema that it sets up for objects related to each other 
relies on foreign keys.  Unfortunately, foreign key enforcement in SQLite, as 
now specified and implemented, only lasts from the time a PRAGMA is issued to 
turn it on until the connection is closed.  Without some trickery, (or 
modifying System.Data.SQLite from its distributed form), I see no way to hook 
DB opens so that I can get foreign key enforcement turned on when it needs to 
be on.

I recognize that I can compile SQLite myself with foreign key enforcement 
defaulted to on.  I may have to do that, but it would be nicer to be able to 
use System.Data.SQLite as built and distributed by sqlite.org .

Perhaps it would make sense for foreign key enforcement to be made persistent 
if something like
  PRAGMA foreign_keys(1, 'PERSISTENT')
was executed.  This could work to turn enforcement off, which could be useful 
once SQLite begins having it on by default.

If anybody knows how to solve this more easily than suggested above, I would 
appreciate your input.

Thanks,
-- Larry Brasfield
*
*
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Entity Framework 6.0 alpha 2

2012-12-18 Thread David Richardson
There is an open source version of entity framework version (EF, version 6.0). 
I want to try it out with mono to see how it works but sadly I have this 
ADO.netprovider problem here (sqlite 1.0.82.0).  I get the following error with 
the new EF 6.0:



No Entity Framework provider found for 'System.Data.SQLite' ADO.NET provider. 
Make sure the provider is registered in the 'entityFramework' section of the 
application config file. See http://go.microsoft.com/fwlink/?LinkId=260882 for 
more information.


so I checked out that link and it says:

What if the provider I need isn’t available?
If the provider is available for previous versions of EF, then we encourage you 
to contact the owner of the provider and ask them to create an EF6 version. You 
should include a reference to the documentation on how to rebuild providers for 
EF6.
I can see that system.data.sqlite is not mentioned on that list. So I'm 
wondering if there is a beta or alpha version that i can use? If not, when can 
I expect one?
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Fw: sqlite + EF4 + 'on cascade delete' = not working

2012-10-13 Thread David Richardson
Ok I found a solution a week ago.  It was really simple to do:

ModelEntities1 ModelData = new ModelEntities1(connString.ConnectionString);
               ModelData.Connection.Open();
                ModelData.ExecuteStoreCommand("PRAGMA foreign_keys = ON");


EF has its own open and close connections mechanism but you can open it 
yourself too. The easiest thing (ofcourse less writing) is the make a static 
class (e.g. Modelconnection) and do something like 'ModelEntities1 ModelData = 
Modelconnection.getConnection())'


____
 From: David Richardson <daviric...@yahoo.com>
To: "Duquette, William H (318K)" <william.h.duque...@jpl.nasa.gov>; General 
Discussion of SQLite Database <sqlite-users@sqlite.org> 
Sent: Thursday, October 4, 2012 12:21 PM
Subject: Re: [sqlite] Fw: sqlite  + EF4 + 'on cascade delete' = not working
 
Yes, that is the problem: How to do this with entity framework? 

Entity framework does all the class making from the model (ORM). great tool. 
But I find it weird that nobody has stumble upon this problem. I cannot find a 
conclusive answer on this.
you know:
NO(, It is not possible. because[...] . or it will be possible in the next 
build)
YES(, override this and this and there you go)

all the answer are vague on the matter or left alone. So that is why I'm here.




From: "Duquette, William H (318K)" <william.h.duque...@jpl.nasa.gov>
To: David Richardson <daviric...@yahoo.com>; General Discussion of SQLite 
Database <sqlite-users@sqlite.org> 
Sent: Thursday, October 4, 2012 11:57 AM
Subject: Re: [sqlite] Fw: sqlite  + EF4 + 'on cascade delete' = not working


On 10/4/12 8:26 AM, "David Richardson" <daviric...@yahoo.com> wrote:

Yes, I've read about it. I try to implemented it but it did not seem to work. I 
even read somewhere that you can add this to the connectionstring but no luck 
with them.
>
>
>I tried all these solutions:
>http://stackoverflow.com/questions/2477872/problem-with-cascade-delete-using-entity-framework-and-system-data-sqlite
>
>http://stackoverflow.com/questions/7674318/cascade-on-delete-not-cascading-with-ef
>
>http://stackoverflow.com/questions/4981353/how-to-enable-foreign-key-cascade-delete-by-default-in-sqlite
>
>
>
>But none of these worked. Either I'm implementing it wrong or there is a bug. 
>So i was expecting an out-of-the-box solution to this issue. So do you have an 
>working example on how to do this the right way? 

I just eval "PRAGMA foreign_keys = ON" as soon as I open the connection, and 
the cascading deletes in the schema all take place as expected.

However, I'm not using Entity Framework 4 or anything like it; there's 
evidently something else going on.

Will

>
> From: "Duquette, William H (318K)" <william.h.duque...@jpl.nasa.gov>
>To: David Richardson <daviric...@yahoo.com>; General Discussion of SQLite 
>Database <sqlite-users@sqlite.org> 
>Sent: Thursday, October 4, 2012 10:39 AM
>Subject: Re: [sqlite] Fw: sqlite + EF4 + 'on cascade delete' = not working
>
>On 10/4/12 7:29 AM, "David Richardson" <daviric...@yahoo.com> wrote:
>
>
>>I¹m having some sort of
>>bug with system.data.sqlite. I¹ve been trying for weeks now!  I¹ve
>>installed (System.Data.SQLite 1.0.81.0) and
>>i¹m using sqlite in combination with Entity Framework 4. Mostly it does
>>what I
>>want. The only problem I¹m having is that when I try to delete it should
>>cascade , but 'on cascade delete¹ does NOT work. I change
>>the connectionstring to SQL Server 2008 instance and entity framework
>>works
>>perfect! So there is something missing here. Or am I doing something
>>wrong?
>
>
>Have you enabled foreign keys using the "foreign_keys" pragma?  This
>currently needs to be done each time you connect to the database.
>
>Will
>--
>Will Duquette -- william.h.duque...@jpl.nasa.gov
>Athena Development Lead -- Jet Propulsion Laboratory
>"It's amazing what you can do with the right tools."
>
>
>
>
>
>
>
>
>
>
>> 
>>I cannot find any
>>information on the internet on how to do this with system.data.sqlite
>>properly. 
>> 
>>Is this a bug?
>>___
>>sqlite-users mailing list
>>sqlite-users@sqlite.org
>>http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
>
>
> 
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Fw: sqlite + EF4 + 'on cascade delete' = not working

2012-10-04 Thread David Richardson
Yes, that is the problem: How to do this with entity framework? 

Entity framework does all the class making from the model (ORM). great tool. 
But I find it weird that nobody has stumble upon this problem. I cannot find a 
conclusive answer on this.
you know:
NO(, It is not possible. because[...] . or it will be possible in the next 
build)
YES(, override this and this and there you go)

all the answer are vague on the matter or left alone. So that is why I'm here.




 From: "Duquette, William H (318K)" <william.h.duque...@jpl.nasa.gov>
To: David Richardson <daviric...@yahoo.com>; General Discussion of SQLite 
Database <sqlite-users@sqlite.org> 
Sent: Thursday, October 4, 2012 11:57 AM
Subject: Re: [sqlite] Fw: sqlite  + EF4 + 'on cascade delete' = not working
 

On 10/4/12 8:26 AM, "David Richardson" <daviric...@yahoo.com> wrote:

Yes, I've read about it. I try to implemented it but it did not seem to work. I 
even read somewhere that you can add this to the connectionstring but no luck 
with them.
>
>
>I tried all these solutions:
>http://stackoverflow.com/questions/2477872/problem-with-cascade-delete-using-entity-framework-and-system-data-sqlite
>
>http://stackoverflow.com/questions/7674318/cascade-on-delete-not-cascading-with-ef
>
>http://stackoverflow.com/questions/4981353/how-to-enable-foreign-key-cascade-delete-by-default-in-sqlite
>
>
>
>But none of these worked. Either I'm implementing it wrong or there is a bug. 
>So i was expecting an out-of-the-box solution to this issue. So do you have an 
>working example on how to do this the right way? 

I just eval "PRAGMA foreign_keys = ON" as soon as I open the connection, and 
the cascading deletes in the schema all take place as expected.

However, I'm not using Entity Framework 4 or anything like it; there's 
evidently something else going on.

Will

>________
> From: "Duquette, William H (318K)" <william.h.duque...@jpl.nasa.gov>
>To: David Richardson <daviric...@yahoo.com>; General Discussion of SQLite 
>Database <sqlite-users@sqlite.org> 
>Sent: Thursday, October 4, 2012 10:39 AM
>Subject: Re: [sqlite] Fw: sqlite + EF4 + 'on cascade delete' = not working
>
>On 10/4/12 7:29 AM, "David Richardson" <daviric...@yahoo.com> wrote:
>
>
>>I¹m having some sort of
>>bug with system.data.sqlite. I¹ve been trying for weeks now!  I¹ve
>>installed (System.Data.SQLite 1.0.81.0) and
>>i¹m using sqlite in combination with Entity Framework 4. Mostly it does
>>what I
>>want. The only problem I¹m having is that when I try to delete it should
>>cascade , but 'on cascade delete¹ does NOT work. I change
>>the connectionstring to SQL Server 2008 instance and entity framework
>>works
>>perfect! So there is something missing here. Or am I doing something
>>wrong?
>
>
>Have you enabled foreign keys using the "foreign_keys" pragma?  This
>currently needs to be done each time you connect to the database.
>
>Will
>--
>Will Duquette -- william.h.duque...@jpl.nasa.gov
>Athena Development Lead -- Jet Propulsion Laboratory
>"It's amazing what you can do with the right tools."
>
>
>
>
>
>
>
>
>
>
>> 
>>I cannot find any
>>information on the internet on how to do this with system.data.sqlite
>>properly. 
>> 
>>Is this a bug?
>>___
>>sqlite-users mailing list
>>sqlite-users@sqlite.org
>>http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
>
>
> 
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Fw: sqlite + EF4 + 'on cascade delete' = not working

2012-10-04 Thread David Richardson
Yes, I've read about it. I try to implemented it but it did not seem to work. I 
even read somewhere that you can add this to the connectionstring but no luck 
with them.

I tried all these solutions:
http://stackoverflow.com/questions/2477872/problem-with-cascade-delete-using-entity-framework-and-system-data-sqlite

http://stackoverflow.com/questions/7674318/cascade-on-delete-not-cascading-with-ef

http://stackoverflow.com/questions/4981353/how-to-enable-foreign-key-cascade-delete-by-default-in-sqlite


But none of these worked. Either I'm implementing it wrong or there is a bug. 
So i was expecting an out-of-the-box solution to this issue. So do you have an 
working example on how to do this the right way?


 From: "Duquette, William H (318K)" <william.h.duque...@jpl.nasa.gov>
To: David Richardson <daviric...@yahoo.com>; General Discussion of SQLite 
Database <sqlite-users@sqlite.org> 
Sent: Thursday, October 4, 2012 10:39 AM
Subject: Re: [sqlite] Fw: sqlite  + EF4 + 'on cascade delete' = not working
 
On 10/4/12 7:29 AM, "David Richardson" <daviric...@yahoo.com> wrote:


>I¹m having some sort of
>bug with system.data.sqlite. I¹ve been trying for weeks now!  I¹ve
>installed (System.Data.SQLite 1.0.81.0) and
>i¹m using sqlite in combination with Entity Framework 4. Mostly it does
>what I
>want. The only problem I¹m having is that when I try to delete it should
>cascade , but 'on cascade delete¹ does NOT work. I change
>the connectionstring to SQL Server 2008 instance and entity framework
>works
>perfect! So there is something missing here. Or am I doing something
>wrong?


Have you enabled foreign keys using the "foreign_keys" pragma?  This
currently needs to be done each time you connect to the database.

Will
--
Will Duquette -- william.h.duque...@jpl.nasa.gov
Athena Development Lead -- Jet Propulsion Laboratory
"It's amazing what you can do with the right tools."










> 
>I cannot find any
>information on the internet on how to do this with system.data.sqlite
>properly. 
> 
>Is this a bug?
>___
>sqlite-users mailing list
>sqlite-users@sqlite.org
>http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Fw: sqlite + EF4 + 'on cascade delete' = not working

2012-10-04 Thread David Richardson
Hi all,

I'm not sure if this mail was received by the community (on sunday the 31st of 
semptember 2012). I haven't heard anything yet. So I'm sending it again.

Regards,

David Richardson 

- Forwarded Message -
From: David Richardson <daviric...@yahoo.com>
To: "sqlite-users@sqlite.org" <sqlite-users@sqlite.org> 
Sent: Sunday, September 30, 2012 5:24 PM
Subject: sqlite  + EF4 + 'on cascade delete' = not working
 

Hi community
 
I’m having some sort of
bug with system.data.sqlite. I’ve been trying for weeks now!  I’ve installed 
(System.Data.SQLite 1.0.81.0) and
i’m using sqlite in combination with Entity Framework 4. Mostly it does what I
want. The only problem I’m having is that when I try to delete it should 
cascade , but 'on cascade delete’ does NOT work. I change
the connectionstring to SQL Server 2008 instance and entity framework works
perfect! So there is something missing here. Or am I doing something wrong?
 
I cannot find any
information on the internet on how to do this with system.data.sqlite properly. 
 
Is this a bug?
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] sqlite + EF4 + 'on cascade delete' = not working

2012-10-01 Thread David Richardson
Hi community
 
I’m having some sort of
bug with system.data.sqlite. I’ve been trying for weeks now!  I’ve installed 
(System.Data.SQLite 1.0.81.0) and
i’m using sqlite in combination with Entity Framework 4. Mostly it does what I
want. The only problem I’m having is that when I try to delete it should 
cascade , but 'on cascade delete’ does NOT work. I change
the connectionstring to SQL Server 2008 instance and entity framework works
perfect! So there is something missing here. Or am I doing something wrong?
 
I cannot find any
information on the internet on how to do this with system.data.sqlite properly. 
 
Is this a bug?
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users