Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Delete with Business Object from a Web Form
Message
De
21/11/2003 17:48:37
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Titre:
Delete with Business Object from a Web Form
Divers
Thread ID:
00852521
Message ID:
00852521
Vues:
50
Hi,

Trying to get up to speed with the framework and have a question on what is the proper way to implement the functionality of deleteing. This is lengthy because I'm trying to get as much basic info out in order to cut through the chase.

Background: I have a very basic web project, where I want to have a list page and a details page. My first list page displays the Title and Start Date of some Events via a data grid. The Title text is a url which allows you to edit the information for an Event. Also on the List page is an Add Event url. On my details page, besides the text boxes for editing the event information, are Save, Cancel and Delete buttons (all mm controls).

A little more background info: I'm pretty much following the Dev Guide, in terms of setting up a Web Project/Application along with the Data Access using a Business Object. So far, I'm adding, saving (new and existing records) and even deleteing, but deleting only form a database standpoint. I don't successfully make it through the whole delete operation as far as the framework is concerned.

The reason I don't make it through the delete operation (framework wise) is that I'm sitting on my details page, which is setup for two-way data binding and after doing the database part of the delete, the framework is attempting to bind the controls back to the dataset, which is "undefined". I've traced it to find what the exact problem was and the error message states the same.

The link from list page passes the ID of the record to the details page via the Querystring. The details page registers the business object and makes a call to a method which calls a SQL Server store proc to get the Event record and returns a Dataset. I push the Dataset to a session variable, for safe keeping. For deleting, the delete button restores the Dataset from the session and then calls the Business Object's delete method. Specifically I'm using the overload which accepts the DataSet, the Tablename and the row to Delete. I've tried them all (each overload), before I realized that that was not the issue, because the record was getting deleted from the database.

Again after tracing this through to get to the real issue, I realized that the attempt to bind the controls to an undefined "object" was the problem. So my question (finally) is what is the thinking behind the Business Object Delete? Is it that, you should only delete from the list page, where there will be other records in the DataSet? That doesn't make sense, but it is the best way to re-ask the question? Better yet, how can I make it not attempt to rebind the objects on the page? Because after a successfull delete then I want to return to the list page. Or is it that I'm doing something wrong or haven't set something properly (very much possible)?

Finally, I'm new to MM.net and really want to understand the basics of the framework before I jump into a full blown project with it. Any wisdom given will be greatly appreciated and not wasted.

Thanks,
Carter Marshall
Total Solutions & Designs, Inc.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform