Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Entity Framework with MySQL Issues

Entity Framework with MySQL Issues

Scheduled Pinned Locked Moved ASP.NET
csharpdatabasehtmlasp-netmysql
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    umeshamin
    wrote on last edited by
    #1

    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

    J 1 Reply Last reply
    0
    • U umeshamin

      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

      J Offline
      J Offline
      jkirkerx
      wrote on last edited by
      #2

      [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

      Richard DeemingR 1 Reply Last reply
      0
      • J jkirkerx

        [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

        Richard DeemingR Offline
        Richard DeemingR Offline
        Richard Deeming
        wrote on last edited by
        #3

        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

        "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups