Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Exception when saving
Message
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
01065248
Message ID:
01065317
Views:
23
Douglas,

>My business object catches the following exception while trying to save data to a database in a asp.net application.
>
>
>"Prepared statement '(@p1 char(16),@p2 int,@p3 datetime,@p4 char(16),@p5 int,@p6 int,' expects parameter @p2, which was not supplied."	string
>
>
>The business object updates some fields in the table right before a second method gets called to update some more fields. If I set the business object to null after the first save and create a new one before calling the second save method it works fine.
>
>It looks like the “Prepared statement” is a combination of the two update statements in the different methods.
>
>I have not changed the default value of the UpdateSelectStatement field for the biz object.

Are you using a custom data access class? Is this the insert, update or delete statement? You can put a breakpoint in mmDataAccessSql (or whichever data access class you're using) in the CreateInsertCommand(), CreateUpdateCommand() and CreateDeleteCommand() methods to see what's happening.

Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform