views:

84

answers:

1

I have a datacontext say myDataContext, it has on several classes (tables) and stored procedures, one of which deletes directly from the database (the logic requires this), however, the deleted rows remain in my myDataContext unless I initialize it again. Is there a way to avoid this? The stored procedure removes the record from the database successfully but until I next open the form, the record is still there.

Thanks

A: 

You have to refresh the data in your context after deleting the rows from the database by executing the DataContext.Refresh method.

Robert Harvey