Monday 15 August 2011

c# - LINQPad treating query as an update but Visual Studios is treating it as an Insert. What could be going wrong? -


I have a unit framework connected to the Oracle database.

I have the following C # code. Use

  (var db = new myDB ()) {var temp = (db.TABLE in SD where s.ID == 5736 s). SINGLEOrDefault (); Temp.DONE = "A"; Db.Entry (temp) .set = System.Data.Entity.EntityState.Modified; Db.SaveChanges (); }  

I am getting an item from the database and then saving it back.

An exception is thrown when I do in VS. Internal error gives me an oracle error.

ORA-00001: Unique obligation (MYDB.SOME_THING_ID) was violated

This indicates to me that I am trying to convert items Put it back in the database with the same thing that is in it.

When the same code is run as C # description via LINQPad. No error has been thrown, while actually checking for SQL, it actually does an update.

Checking the database, my item has been updated.

The same for data access DLL and similar .comfig files were used. I am confused for what might be wrong.


No comments:

Post a Comment