ExecuteNonQuery not always inserts row: what reasons?

Tuesday, July 8, 2014

Context is following: i am developing some website and have to work with third party database: no one of tables contains primary key and they have inconvenient schemas. Have added my own table and create one-to-one relationship, but cause of there are no PK in tables, this was done in client side (for example, if insert new row - do it for two tables artificially and so on).Problem is with inserting row in third party table - ExecuteNonQuery returns zero affected rows and no exceptions raised. But sometimes inserting are done. BTW: tried to do this with EF, but DbUpdateException is raised with the same table(s).Think this happens due to PK absence. (Store insert statement affected an unexpected number of rows (0). Entities may have been modified or deleted since entities were loaded).But with my tables all work fine. Any ideas? All advices will be appreciated. And what about integration in such cases? Thanks in advance.