Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Delete Stored Procedure
Message
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
01190307
Message ID:
01194135
Views:
21
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform