Entity Framework with MySQL Issues
-
I'm a beginner with c# / asp.net and I'm trying to get entity framework code-first working with mySQL usign a variety of tutorials.. I've managed to get through loads of issues but this one is killing me:
When I try to migrate the database I receive the following error: MySql.Data.MySqlClient.MySqlException (0x80004005): Unknown column 'no' in 'field list'
Based on the SQL generated:
set @columnType := (select case lower(IS_NULLABLE) when `no` then CONCAT(column_type, ` ` , `not null `) when `yes` then column_type end from information_schema.columns where table_name = `Student` and column_name = `FirstMidName` );
mySQL doesn't know WTF the ` character is.. This should be either ' or " -- Is there any way to tell the migrator that this should be the case?P.S. In my Migration config I have the following code:
SetSqlGenerator("MySql.Data.MySqlClient", new MySqlMigrationSqlGenerator());
________________________________________________________________________________________ cloud meeting builders in dombivali 3 bhk flats in dadar
-
I'm a beginner with c# / asp.net and I'm trying to get entity framework code-first working with mySQL usign a variety of tutorials.. I've managed to get through loads of issues but this one is killing me:
When I try to migrate the database I receive the following error: MySql.Data.MySqlClient.MySqlException (0x80004005): Unknown column 'no' in 'field list'
Based on the SQL generated:
set @columnType := (select case lower(IS_NULLABLE) when `no` then CONCAT(column_type, ` ` , `not null `) when `yes` then column_type end from information_schema.columns where table_name = `Student` and column_name = `FirstMidName` );
mySQL doesn't know WTF the ` character is.. This should be either ' or " -- Is there any way to tell the migrator that this should be the case?P.S. In my Migration config I have the following code:
SetSqlGenerator("MySql.Data.MySqlClient", new MySqlMigrationSqlGenerator());
________________________________________________________________________________________ cloud meeting builders in dombivali 3 bhk flats in dadar
[Edit] MySQL doesn't quite lineup like SQL Server does, and you will find code examples that work with SQL server and don't with MySQL. Like column types, and nomenclature like nullable. To the best of my knowledge, when you program the context and choose MySQL, the intellisense doesn't give you known MySQL choices. Same with choosing Oracle or SQLite. The are some cheat sheets out there that will help you translate this, or you have to figure it out by experimenting. I remember when I started using EF, it was really hard to learn how to code the context, and do automatic database updates. I like MySQL, and can see using EF with it. But today, I wouldn't waste my time with that technology.
If it ain't broke don't fix it Discover my world at jkirkerx.com
-
[Edit] MySQL doesn't quite lineup like SQL Server does, and you will find code examples that work with SQL server and don't with MySQL. Like column types, and nomenclature like nullable. To the best of my knowledge, when you program the context and choose MySQL, the intellisense doesn't give you known MySQL choices. Same with choosing Oracle or SQLite. The are some cheat sheets out there that will help you translate this, or you have to figure it out by experimenting. I remember when I started using EF, it was really hard to learn how to code the context, and do automatic database updates. I like MySQL, and can see using EF with it. But today, I wouldn't waste my time with that technology.
If it ain't broke don't fix it Discover my world at jkirkerx.com
You're replying to a spammer - look at the links in the footer.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer