tag:blogger.com,1999:blog-23066745.post5002449740987303492..comments2023-07-01T01:49:01.512-07:00Comments on Brice's Blog: Using Entity Framework 4.3 Code First with MySQL's Connector/NetBrice Lambsonhttp://www.blogger.com/profile/15198181959237268022noreply@blogger.comBlogger25125tag:blogger.com,1999:blog-23066745.post-88416980115805908262013-05-29T06:44:22.920-07:002013-05-29T06:44:22.920-07:00Anybody has done below example successfully
http...Anybody has done below example successfully <br /><br />https://blogs.oracle.com/MySqlOnWindows/entry/building_an_mvc_3_application<br /><br />I have tried above example , also tried work around, but no luck<br /><br />Can you help me out?Anonymoushttps://www.blogger.com/profile/04460159100548994972noreply@blogger.comtag:blogger.com,1999:blog-23066745.post-84862978044596809492013-05-29T03:36:47.165-07:002013-05-29T03:36:47.165-07:00HI EF5 Code First will work with VS2012 mysql 5.6 ...HI EF5 Code First will work with VS2012 mysql 5.6 and connector/Net 6.6.5,<br /><br />I have tried bu not creating DB<br /><br />can I get example for same?Anonymoushttps://www.blogger.com/profile/04460159100548994972noreply@blogger.comtag:blogger.com,1999:blog-23066745.post-37147008892229183992013-05-20T16:32:13.284-07:002013-05-20T16:32:13.284-07:00Currently I'm working with an existing MySQL d...Currently I'm working with an existing MySQL database (need to retain data and table structure) and adding in migrations. Unfortunately I'm running into problems with the 'update-database' command failing with saying that the database already exists. I've tried using CreateDatabaseIfNotExist as the initialiser, though that seems to be ignored and it tries to create the database anyway. I'm using version 6.6.5 of the MySQL connector.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-23066745.post-71026831597000307892013-03-28T01:05:20.940-07:002013-03-28T01:05:20.940-07:00Brice. Thanks for the great writeups.
Generating ...Brice. Thanks for the great writeups. <br />Generating a EDMX from MySQL takes a looooong time. Is that something that MSFT could fix or is it something that the folks writing the .net connector for mysql should fix? Our MySQl Database has about 60 tables and it takes 40 minutes to generate the entity data model. Love the speed and flexibility that entity framework brings to development and it would be great to see it play better with MySQLmanny Snoreply@blogger.comtag:blogger.com,1999:blog-23066745.post-47267450774883713622013-03-17T22:37:18.684-07:002013-03-17T22:37:18.684-07:00@Brice
Hello sir when i am trying to create Contro...@Brice<br />Hello sir when i am trying to create Controller woth mvc read/ write actions with mysql database i am getting this error<br /><br />"Unable to retrieve metadata for ProjectBuild"."Using the same DbCompiledModel to create contexts against different types of database servers is not supported. Instead, create a separate DbCompiledModel for each type of server being used.<br /><br />what will be the problemAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-23066745.post-1953473697028719812013-03-09T12:13:14.649-08:002013-03-09T12:13:14.649-08:00@Brice Sir ,
Thanks for the information given.
As...@Brice Sir ,<br />Thanks for the information given.<br /><br />As i am new to MVC4 , EF and MYSQl ,I still have a doubt, I am using EF 5 and My SQL Connector 6.5.5 . I am unable to generate the database by using code first appraoch . What Will be the problem . What are the recommended version of EF and Connector to generate the daatebase by using code-first approach.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-23066745.post-50618353087471708352013-03-05T09:34:35.575-08:002013-03-05T09:34:35.575-08:00@Anonymous This issue was fixed in Connector/Net v...@Anonymous This issue was fixed in Connector/Net version 6.6.3. I've updated my post with this information. You should be able to use Code First normally as described in <a href="http://brice-lambson.blogspot.com/2012/10/entity-framework-on-mysql.html" rel="nofollow">this post</a>.Brice Lambsonhttps://www.blogger.com/profile/15198181959237268022noreply@blogger.comtag:blogger.com,1999:blog-23066745.post-58745999535969906512013-03-05T01:21:11.444-08:002013-03-05T01:21:11.444-08:00Hello sir is it necessary to Create a Custom MySql...Hello sir is it necessary to Create a Custom MySql Database Initializer for MySQL 6.6.5 version . Can U explain how to Use EF Code First Approch with MYSQL 6.6.5 versionAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-23066745.post-47101920433524625602012-12-10T15:52:50.253-08:002012-12-10T15:52:50.253-08:00@Dorababu, you may want to try http://bugs.mysql.c...@Dorababu, you may want to try http://bugs.mysql.com/ instead. Things look good to my EF eyes, but I don't have a whole lot of experience with Connector/Net to say exactly what could be going wrong.Brice Lambsonhttps://www.blogger.com/profile/15198181959237268022noreply@blogger.comtag:blogger.com,1999:blog-23066745.post-62227080618141267752012-12-10T04:32:38.137-08:002012-12-10T04:32:38.137-08:00Hi I am using 6.3.5.0 MySql, and I have a table wh...Hi I am using 6.3.5.0 MySql, and I have a table which was created as follows<br /><br /><i>CREATE TABLE `users` (<br /> `UserID` int(11) NOT NULL AUTO_INCREMENT,<br /> `UserName` varchar(45) DEFAULT NULL,<br /> `Password` varchar(45) DEFAULT NULL,<br /> `FirstName` varchar(45) DEFAULT NULL,<br /> `LastName` varchar(45) DEFAULT NULL,<br /> PRIMARY KEY (`UserID`)<br />) ENGINE=InnoDB AUTO_INCREMENT=7</i><br /><br />I am having my routine as follows<br /><i><br />CREATE DEFINER=`root`@`%` PROCEDURE `uspInsertUsers`(_UserName varchar(50),<br />_Password varchar(50),_FirstName varchar(50),_LastName varchar(50))<br />BEGIN<br />insert into users(UserName,Password,FirstName,LastName)values(_UserName,<br />_Password,_FirstName,_LastName);<br />END<br /></i><br /><br />In my code using entity framework I code as follows<br /><br />MySqlParameter userName = new MySqlParameter("@UserName", txtUserName.Text);<br /> //userName.Value = txtUserName.Text;<br /> MySqlParameter password = new MySqlParameter("@Password", txtPassword.Text);<br /> //password.Value = txtPassword.Text;<br /> MySqlParameter FirstName = new MySqlParameter("@FirstName", txtFirstName.Text);<br /> //FirstName.Value = txtFirstName.Text;<br /> MySqlParameter LastName = new MySqlParameter("@LastName", txtLastName.Text);<br /> //LastName.Value = txtLastName.Text;<br /><br /> entities.ExecuteStoreCommand("uspInsertUsers @UserName,@Password,@FirstName,@LastName", userName, password, FirstName, LastName);<br /><br />But I am getting an exception as <b>You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'uspInsertUsers 'Dorababu','sairam','Dorababu','M'' at line 1</b><br /><br />Can you help meDorababuhttps://www.blogger.com/profile/08685478436586902404noreply@blogger.comtag:blogger.com,1999:blog-23066745.post-1084215851981992852012-08-15T09:21:40.827-07:002012-08-15T09:21:40.827-07:00@Delush As far as I know, Devart has the only Migr...@Delush As far as I know, <a href="http://www.devart.com/dotconnect/mysql/" rel="nofollow">Devart</a> has the only Migrations-enabled EF provider for MySQL.Brice Lambsonhttps://www.blogger.com/profile/15198181959237268022noreply@blogger.comtag:blogger.com,1999:blog-23066745.post-46592224120414091202012-08-14T23:28:51.243-07:002012-08-14T23:28:51.243-07:00Hi Brice,
I tried Migration with MySQL, when trie...Hi Brice,<br /><br />I tried Migration with MySQL, when tried to Update-Database got an error<br /><br />"No MigrationSqlGenerator found for provider 'MySql.Data.MySqlClient'. Use the SetSqlGenerator method in the target migrations configuration class to register additional SQL generators."<br /><br />when tried to use SetSqlGenerator method, found that Migration is not supported with "MySqlClient". Could you please find me a solution for this.Delush Sasankahttps://www.blogger.com/profile/17239748305736659025noreply@blogger.comtag:blogger.com,1999:blog-23066745.post-32863699568066384592012-08-14T23:24:04.231-07:002012-08-14T23:24:04.231-07:00This comment has been removed by the author.Delush Sasankahttps://www.blogger.com/profile/17239748305736659025noreply@blogger.comtag:blogger.com,1999:blog-23066745.post-25985414666598688022012-08-02T04:12:45.597-07:002012-08-02T04:12:45.597-07:00It now works with the connector 6.6 (in alpha yet)...It now works with the connector 6.6 (in alpha yet)Timnoreply@blogger.comtag:blogger.com,1999:blog-23066745.post-61220437188150442582012-07-21T01:23:05.061-07:002012-07-21T01:23:05.061-07:00(sorry for my bad english)
Thank you for this post...(sorry for my bad english)<br />Thank you for this post. Now what would be even better is Code First Migrations support for MySQL ;)<br />Has anybody been able to make it work?Leonoreply@blogger.comtag:blogger.com,1999:blog-23066745.post-33080089110489254302012-07-17T15:39:03.826-07:002012-07-17T15:39:03.826-07:00Thanks Brice,
I really have to thank you for this....Thanks Brice,<br />I really have to thank you for this.<br />Cheers Brother..!Delush Sasankahttps://www.blogger.com/profile/17239748305736659025noreply@blogger.comtag:blogger.com,1999:blog-23066745.post-54904468160020124472012-07-06T09:21:03.332-07:002012-07-06T09:21:03.332-07:00There is a new column in the migrations table in E...There is a new column in the migrations table in EF 4.3.1 "CreatedOn".<br /><br />The CreateMyDatabase method needs to be changed to the following:<br /><br />https://gist.github.com/3061139Anonymoushttps://www.blogger.com/profile/01326960032829683988noreply@blogger.comtag:blogger.com,1999:blog-23066745.post-36800068864556688422012-07-06T09:15:33.390-07:002012-07-06T09:15:33.390-07:00This comment has been removed by the author.Anonymoushttps://www.blogger.com/profile/01326960032829683988noreply@blogger.comtag:blogger.com,1999:blog-23066745.post-19864374714218988402012-06-19T23:02:09.440-07:002012-06-19T23:02:09.440-07:00@Anonymous, The code can go anywhere in your proje...@Anonymous, The code can go anywhere in your project -- the examples are complete classes.<br /><br />@Delush Sasanka, in EF 4.3, we switched from using the EdmMetadata table to using the __MigrationHistory.<br /><br />The EdmMetadata table was relatively simple -- just an integer primary key and an additional string column. The MySQL provider had no problem handling this.<br /><br />The __MigrationHistory table was more complex -- it included a string primary key and a binary column. This exposed the two MySQL bugs that I've listed.<br /><br />To be clear, these two bugs existed prior to EF 4.3, it's just that the EF runtime was never hitting them. Other projects using EF may have been.Brice Lambsonhttps://www.blogger.com/profile/15198181959237268022noreply@blogger.comtag:blogger.com,1999:blog-23066745.post-62548588621301673912012-06-17T17:12:29.960-07:002012-06-17T17:12:29.960-07:00But it work fine with older versions of Entity fra...But it work fine with older versions of Entity framework?<br />why is that?Delush Sasankahttps://www.blogger.com/profile/17239748305736659025noreply@blogger.comtag:blogger.com,1999:blog-23066745.post-77867087760587613382012-06-06T14:00:49.084-07:002012-06-06T14:00:49.084-07:00Would you mind telling me where I should place thi...Would you mind telling me where I should place this code? I'm building a CRM and migrating to MySQL. Love the EFCode first approach but my brains exploding from dealing with Tax Software all day.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-23066745.post-26110193629126344282012-06-06T13:10:12.278-07:002012-06-06T13:10:12.278-07:00Good job!
This works fine !
The MySQL Team too p...Good job!<br /><br />This works fine !<br /><br />The MySQL Team too posted another solution, change and build the MySQL Code.<br /><br />http://forums.mysql.com/read.php?38,519005,535207#msg-535207Leandro Ribeirohttp://www.leandroribeiro.comnoreply@blogger.comtag:blogger.com,1999:blog-23066745.post-75197586931354513102012-05-14T09:35:54.494-07:002012-05-14T09:35:54.494-07:00lol, I wouldn't feel bad; I work on the Entity...lol, I wouldn't feel bad; I work on the Entity Framework team at Microsoft. I had extra incentive to throughly investigate the issue and file bugs. ;)Brice Lambsonhttps://www.blogger.com/profile/15198181959237268022noreply@blogger.comtag:blogger.com,1999:blog-23066745.post-50883559816725170132012-05-12T00:43:37.358-07:002012-05-12T00:43:37.358-07:00I've also encountered this error and I posted ...I've also encountered this error and I posted it http://blogs.msdn.com/b/adonet/archive/2012/02/09/ef-4-3-automatic-migrations-walkthrough.aspx#10301376 and http://stackoverflow.com/q/10464621/148271.<br /><br />I thought it is problem with EF rather than MySql connector. But you might be right.<br /><br />Thanks for sharing the workaround.<br />And after reading your blog, I feel that I'm not a good Open Source developer.Ismailhttps://www.blogger.com/profile/08704688677778638328noreply@blogger.comtag:blogger.com,1999:blog-23066745.post-28535876550400221922012-05-12T00:24:30.781-07:002012-05-12T00:24:30.781-07:00This comment has been removed by the author.Ismailhttps://www.blogger.com/profile/08704688677778638328noreply@blogger.com