tag:blogger.com,1999:blog-23066745.post7715927803228740516..comments2023-07-01T01:49:01.512-07:00Comments on Brice's Blog: Entity Framework 5 on SQLiteBrice Lambsonhttp://www.blogger.com/profile/15198181959237268022noreply@blogger.comBlogger53125tag:blogger.com,1999:blog-23066745.post-91092185199077324232014-04-18T13:01:09.271-07:002014-04-18T13:01:09.271-07:00Could you please add a new example of how to accom...Could you please add a new example of how to accomplish this with the updated versions? I have spent hours trying and keep getting various errors. Or would you atleast be able to post the full working App.Config file? As I believe that is where all the errors are coming from.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-23066745.post-69162552023662300602014-03-11T15:10:10.514-07:002014-03-11T15:10:10.514-07:00all the async extensions seem to throw "Inval...all the async extensions seem to throw "InvalidCastException".<br />E.g.:<br />await Context.Customers.LoadAsync();<br /><br />is there a workaround? thanks.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-23066745.post-88773244631066941622014-02-16T11:46:47.717-08:002014-02-16T11:46:47.717-08:00Hi Brice,
Thanks for the article.
But I am gettin...Hi Brice,<br />Thanks for the article.<br /><br />But I am getting below exception.<br /><br />The type initializer for 'System.Data.Entity.Internal.AppConfig' threw an exception.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-23066745.post-70145659531658939372013-11-12T04:06:15.377-08:002013-11-12T04:06:15.377-08:00Foriegn Key relation doesn't work. When I do A...Foriegn Key relation doesn't work. When I do Artist.Albums, it throws ObjectDisposedExceptionAnonymoushttps://www.blogger.com/profile/13488189709645962321noreply@blogger.comtag:blogger.com,1999:blog-23066745.post-6565061248643585422013-11-06T02:13:19.385-08:002013-11-06T02:13:19.385-08:00I use with sqlite a free tool Valentina Studio at ...I use with sqlite a free tool Valentina Studio at the moment. Does everything you need, and does it very well. http://www.valentina-db.com/en/valentina-studio-overviewAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-23066745.post-31070808679826354672013-10-10T22:27:30.952-07:002013-10-10T22:27:30.952-07:00This comment has been removed by the author.Anonymoushttps://www.blogger.com/profile/00159784893696194953noreply@blogger.comtag:blogger.com,1999:blog-23066745.post-12497005080407955792013-10-10T22:26:53.707-07:002013-10-10T22:26:53.707-07:00Hey Brice.
Say i want to use another database.
Th...Hey Brice.<br /><br />Say i want to use another database.<br />The classes i create need to be identical to the database structure?<br /><br />EF will connect each property to the table field by the name?Anonymoushttps://www.blogger.com/profile/00159784893696194953noreply@blogger.comtag:blogger.com,1999:blog-23066745.post-24289980692404007412013-10-08T12:27:14.003-07:002013-10-08T12:27:14.003-07:00I have created a new database file. Using that I&#...I have created a new database file. Using that I'am getting <br />System.Data.Entity.ModelConfiguration.ModelValidationException<br /><br />Is it because if the wrong use of the types in my model classes. Is there any way to see the .sqlite file. I have an sqlite editor but it is not opening the database fileAnonymoushttps://www.blogger.com/profile/13488189709645962321noreply@blogger.comtag:blogger.com,1999:blog-23066745.post-18872438016720529532013-10-08T07:26:55.212-07:002013-10-08T07:26:55.212-07:00This comment has been removed by the author.Anonymoushttps://www.blogger.com/profile/13488189709645962321noreply@blogger.comtag:blogger.com,1999:blog-23066745.post-72285052133580369372013-09-22T17:34:29.071-07:002013-09-22T17:34:29.071-07:00Great thanks for the great start up example! Now I...Great thanks for the great start up example! Now I'm learning EF from Julie Lerman's "Learning Entity Framework"Anonymoushttps://www.blogger.com/profile/07599801757430010363noreply@blogger.comtag:blogger.com,1999:blog-23066745.post-7857165760716803822013-09-10T09:16:52.347-07:002013-09-10T09:16:52.347-07:00I spent a LOT of time getting this working in a cl...I spent a LOT of time getting this working in a class library as a plug-in to a third-party product. All kinds of issues with not being able to set connect strings or DbProviders due to the dll not referencing the config. There are work-arounds but they're messy and annoying - eg as having to deploy the SQLite dlls to the parant application's folder and manipulating the machine.config programmatically. Blech. (Why Microsoft won't allow class libraries to (optionally) refer to their own config at run time escapes me and I think quite a few other people as there are definitely times when it would be preferable.) These problems are not specific to SQLite/Data Entity/System.Data.SQLite, btw. Unknownhttps://www.blogger.com/profile/05126722384692998634noreply@blogger.comtag:blogger.com,1999:blog-23066745.post-86342252111414271582013-08-23T08:17:38.792-07:002013-08-23T08:17:38.792-07:00@Anonymous As far as I know, it supports database ...@Anonymous As far as I know, it supports database first. You'll need to <a href="http://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki" rel="nofollow">download the SQLite design-time components for Visual Studio</a>. I'm not sure about any migration tools, but you might try asking on StackOverflow.com or ServerFault.com.Brice Lambsonhttps://www.blogger.com/profile/15198181959237268022noreply@blogger.comtag:blogger.com,1999:blog-23066745.post-84648734652426153252013-08-23T00:25:52.887-07:002013-08-23T00:25:52.887-07:00I'm currently using SQL Express and EF "d...I'm currently using SQL Express and EF "database first", but am considering switching to SQLite. <br /><br />Does SQLite support database first? And do you know of any tools that would let me export my SQL database (schema and data) into a SQLite database?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-23066745.post-26259002651984212462013-07-10T13:09:02.502-07:002013-07-10T13:09:02.502-07:00@Bill, as I mentoned to Paul above, "Unfortun...@Bill, as I mentoned to Paul above, "Unfortunately, System.Data.SQLite doesn't yet support DDL generation (see <a href="http://system.data.sqlite.org/index.html/tktview?name=c8083867b9" rel="nofollow">Ticket c8083867b9</a>). I would consider using <a href="http://www.devart.com/dotconnect/sqlite/" rel="nofollow">Devart's provider</a> instead."<br /><br />@butteredtoast, Make sure your connection string is what you expect it to be at runtime (use db.Database.Connection.ConnectionString). If it uses "|DataDirectory|" make sure the database file is inside the App_Data directory.Brice Lambsonhttps://www.blogger.com/profile/15198181959237268022noreply@blogger.comtag:blogger.com,1999:blog-23066745.post-85361752200870651102013-07-10T12:09:45.178-07:002013-07-10T12:09:45.178-07:00I am having troubles referencing the sample databa...I am having troubles referencing the sample database using a Web API interface (verses the console application). I am using the select method in my GET function and I am getting a "SQL logic error or missing database no such table: Artist" error. Any ideas?butteredtoastnoreply@blogger.comtag:blogger.com,1999:blog-23066745.post-35600780365019719052013-07-10T11:26:40.176-07:002013-07-10T11:26:40.176-07:00I have a working set up for NHibernate 3 and SQLit...I have a working set up for NHibernate 3 and SQLite and everything is working exactly the way I want: create an empty database, create the tables, populate the database, etc.<br /><br />Now I want to do the same thing with EF5. Using your tutorial as a starting point, I can get a new database created, but I cannot figure out how to get EF5 to create the tables for me. This should be just as transparent as NHIbernate, as I am using the same SQLite driver. <br /><br />What do you suggest?<br /><br />Thanks,<br />BillBillnoreply@blogger.comtag:blogger.com,1999:blog-23066745.post-68697382750267680512013-07-09T06:08:36.565-07:002013-07-09T06:08:36.565-07:00Oh forget that last comment i was still connecting...Oh forget that last comment i was still connecting to my SqlDB and I had turned of the database initializer. I still cant figure why the connection isn't working though. I made all the connection strings and i can even access it via the Server Explorer.<br /><br />is there anyway to post my app.config to see what the problem is?Alexhttps://www.blogger.com/profile/11032302978781195147noreply@blogger.comtag:blogger.com,1999:blog-23066745.post-33023291880023660112013-07-09T06:07:15.366-07:002013-07-09T06:07:15.366-07:00This comment has been removed by the author.Alexhttps://www.blogger.com/profile/11032302978781195147noreply@blogger.comtag:blogger.com,1999:blog-23066745.post-29303766502495765752013-07-08T21:34:01.844-07:002013-07-08T21:34:01.844-07:00Hi i keep getting "context has changed since ...Hi i keep getting "context has changed since the database was created" error. Whats the equivalent of text field for efAlexhttps://www.blogger.com/profile/11032302978781195147noreply@blogger.comtag:blogger.com,1999:blog-23066745.post-91546435425345841622013-06-21T12:36:30.058-07:002013-06-21T12:36:30.058-07:00@Sylvia, I hit the same issue when writing this po...@Sylvia, I hit the same issue when writing this post; that's why I suggest using the System.Data.SQLite<i>.x86</i> package.Brice Lambsonhttps://www.blogger.com/profile/15198181959237268022noreply@blogger.comtag:blogger.com,1999:blog-23066745.post-46858916968836539512013-06-20T17:04:40.238-07:002013-06-20T17:04:40.238-07:00Hi,I have a question,I do the same thing with this...Hi,I have a question,I do the same thing with this article,but it show error "could not load sqlite.interop.dll",I installed the system.data.sqlite(x86 and x64) using PMD in vistual studio 2012,could you help meSylviahttps://www.blogger.com/profile/12778669429610083483noreply@blogger.comtag:blogger.com,1999:blog-23066745.post-5356359800796778392013-06-19T08:21:41.664-07:002013-06-19T08:21:41.664-07:00@Anonymous, here is an article on Entity Framework...@Anonymous, here is an article on Entity Framework and <a href="http://msdn.microsoft.com/en-us/data/jj574514" rel="nofollow">Databinding with WPF</a>.Brice Lambsonhttps://www.blogger.com/profile/15198181959237268022noreply@blogger.comtag:blogger.com,1999:blog-23066745.post-51178147985739603682013-06-19T03:55:25.450-07:002013-06-19T03:55:25.450-07:00Hi Brice, this is a very interesting topic!
I'...Hi Brice, this is a very interesting topic!<br /><br />I'm not that familiar with Sqlite and entity framework, so I was wondering how it is done within a WPF application (data binding..)<br /><br />Thanks in advance!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-23066745.post-61416687108350263952013-06-18T16:03:21.239-07:002013-06-18T16:03:21.239-07:00Thank you Brice, that was very helpful to me.Thank you Brice, that was very helpful to me.Ryan Stowassernoreply@blogger.comtag:blogger.com,1999:blog-23066745.post-65325183678252066172013-06-18T09:48:41.216-07:002013-06-18T09:48:41.216-07:00@Ryan Stowasser, I'm not entirely sure how you...@Ryan Stowasser, I'm not entirely sure how you want your classes to look, but I'll do my best to reply.<br /><br />You'll need to configure the relationship by overriding OnModelCreating in your DbContext and adding code similar to the following.<br /><br />modelBuilder.Entity<Ticket>().HasOptional(t => t.AssignedToUser).WithMany(u => u.Tickets).HasForeignKey(t => t.AssignedTo);<br /><br />For additional information, see <a href="http://msdn.microsoft.com/en-us/data/jj591620" rel="nofollow">Configuring Relationships with the Fluent API</a>.Brice Lambsonhttps://www.blogger.com/profile/15198181959237268022noreply@blogger.com