Linq To Sql Entity Operations -


I'm trying to use:

  // This is a breakaway class Ado Net Data Entity Modal_Antencies_antity.AdTebreckHistory (this); _entities.SaveChanges ();  

And I can not be referred to "a unit object with many instances of IEntityChangeTracker." Error

I think my update code:

  _entities.ApplyPropertyChanges (this. EntityKey.EntitySetName, this); _entities.SaveChanges ();  

And I'm thinking that I'll probably get the same type of error.

Do I have to get this kind of original bikehistory object?

var BasicBrownHistory = (_entities.BreakHistorySet in BH where bh.BreakHistoryID = Select bh) .FirstOrDefault ();

- Updated 4:40 pm on the same day It seems that I may have another problem that might be related. I am adding the current break-green unit to the manager unit object because they are related and I am getting this error: "The relationship between the two objects can not be defined because they are related to different object object objects."

Could this error be because I am using the same unit model, but I am calling "new" on unit items and loading them with DB ??

Here are some of my codes:

  Secure void lstBreaks_ItemCommand (Object source, Repeat Command Event Arguments E) {var BH = New break history (). Current breakreysist (Int. Purse (E.ComandAgent.tostring ())). Currentman (GetManagerEntityByUserName ()); Switch (e.CommandName) {case "Approved": bh.Approve (); break; Case "Disclaimer": BH Denny (); break; Case "push": bh.Push (); break; } Bh.Save (); LoadBreakList (); }  

For example on acceptance - bh.Approve () looks like this:

  public brehichi accepted () {this.DateApproved = DateTime. Now he; This.ManagerApprove Current = Manager; This return; }  

The manager can approve, reject or push a request, and so the manager is related to breakfasts through a manager.

If you are retrieving the existing records you should not use the new operator. It can happen that what you are hanging out.

Ensure that you are using the same data content object for all your updates, for many reasons it is difficult to move objects from one data transfer to another.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

Visual Studio 2005: How to speed up builds when a VSMDI is open? -

booting ubuntu from usb using virtualbox -