Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Delete Stored Procedure
Message
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
01190307
Message ID:
01194135
Vues:
20
>Dan,
>
>>I want it all and I have already generated the class and stored procedures. The problem is that when I call the Delete method, passing the PK, a DELETE T-SQL command is sent to the server instead of calling the delete stored procedure.
>
>Did you set the DefaultCommandType property in ABusinessObject to "StoredProcedures"? This will cause any Framework-level code to call stored procedures rather than use dynamic SQL.
>
>Best Regards,

Not when I call the business object's Delete method directly when the business object does not have a dataset.
MINExcludePartList bizPartList = new MINExcludePartList();

// pkItem is the primary key of the item to be deleted
if (bizPartList.Delete(pkItem))
{
   MessageBox.Show("Item deleted.");
}
else
{
   MessageBox.Show("Cannot delete the item.");
}
When I trace into the delete method, it first checks if the business object has a dataset. In this case it does not.

Then the code goes into a branch that has a call to ExecNonQuery where it builds a DELETE FROM statement that gets sent to the server.
Thanks,
Dan Jurden
djurden@outlook.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform