locked
Unable to delete entity in entity framework for mysql datasource RRS feed

  • Question

  • Hi,

    I have a mySQL database and is using entity framework to access the data.

    I have been sucessfuly able to add and update off the rows from any table in my database, however I am having problem deleting in my entity.

    As I have check the entityObject.EntityState is already deleted state and I have called the datasourceModelConnection.SaveChanges() to commit the delete to the data source.

    The code executes fine without no exceptions but the data in the DB still have the rows to be removed.


    Friday, December 13, 2013 10:08 AM

Answers

  • If you can profile/trace the MySQL database then you can inspect the delete query and get an idea why it is failing. I suspect the key it is using to delete is not found - or worse, you are deleting completely unexpected rows.


    Bob - www.crowcoder.com

    • Proposed as answer by Fred Bao Monday, December 16, 2013 1:23 AM
    • Marked as answer by Fred Bao Friday, December 20, 2013 11:34 AM
    Friday, December 13, 2013 2:27 PM