StrataFrame Forum

Deleting rows in a view...

http://forum.strataframe.net/Topic2478.aspx

By StarkMike - 8/25/2006

If I create a view and then build a BO based on that view and then bind a grid to that BO, can I delete rows in the grid and have it persist back through the BO to the view and delete the selected rows? I do have more than one table in my view. Dont know if that would matter.



Thanks
By StrataFrame Team - 8/25/2006

We have some users that are creating business objects off of views and creating "Instead Of" triggers on the database, but, no, you cannot delete records from a view unless you either index the view or create INSTEAD OF triggers on the view that will allow you to override the DELETE operation on the view.  You'll also need to modify the partial class after it is built to declare the field that will be the "primary key" for the view so the business object can execute the delete operations on the server.

You could also create stored procedures to delete the records from the view and tell the business object to use the specified delete stored procedure, but again, you'll need to modify the partial class to tell the business object which field to call the primary key.