Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Unexpected error when update record
Message
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Environment versions
Environment:
VB 8.0
Miscellaneous
Thread ID:
01245406
Message ID:
01246642
Views:
24
Wang,

>
>System.InvalidCastException: Unable to cast object of type 'System.String' to type 'System.Data.IDbCommand'.
>   at OakLeaf.MM.Main.Data.mmDataAccessBase.CreateUpdateSelectCommand(DataSet ds, String tableName)
>   at OakLeaf.MM.Main.Data.mmDataAccessSql.SaveDataSet(DataSet ds, String tableName, String primaryKeyName, Boolean retrieveAutoIncrementPK, IDbDataAdapter dbAdapter)
>   at OakLeaf.MM.Main.Business.mmBusinessObject.SaveDataSet(DataSet ds, String tableName, String databaseKey, IDbDataAdapter dbAdapter)
>   at OakLeaf.MM.Main.Business.mmBusinessObject.SaveDataSet(DataSet ds, String tableName, String databaseKey)
>   at OakLeaf.MM.Main.Business.mmBusinessObject.SaveDataSet(DataSet ds, String tableName)
>   at OakLeaf.MM.Main.Business.mmBusinessObject.SaveDataSet(DataSet ds)
>   at OakLeaf.MM.Main.Web.UI.mmBusinessWebPage.Save(mmBusinessObject bizObj, DataSet ds, String tableName)
>   at OakLeaf.MM.Main.Web.UI.mmBusinessWebPage.Save(mmBusinessObject bizObj, String tableName)
>   at OakLeaf.MM.Main.Web.UI.mmBusinessWebPage.Save(mmBusinessObject bizObj)
>
Have you set a value in the business object's UpdateSelectCommand, or did you override the CreateUpdateSelectCommand() method? I recommend setting a breakpoint in mmDataAccessSql.CreateUpdateSelectCommand() and run your code to see what's happening.

Best 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
Reply
Map
View

Click here to load this message in the networking platform