Home »

ObjectDatasource - Object Won’t Delete

26. September 2008 by thebeebs 0 Comments

I was using an ObjectDataSource today, which is rare for me. Everything was working perfectly apart from the deletes. This was because updates and edits pass the full objects back to the ObjectDataSource, however, on delete commands only the properties that are set as Datakeys of the grid are populated and sent back.

In most instances this is fine because to delete an object all you should need is the Primary key. So make sure you add your primary Key as a DataKey for the grid if you want automatic deletes to work ..well…automatically.

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Add comment


(Will show your Gravatar icon)  

  Country flag

biuquote
  • Comment
  • Preview
Loading