Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Exception on Maint WinForm Cancel
Message
 
À
30/04/2010 16:33:11
Alvin Schmucker
Choice Books of Northern Va
Virginie, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
01462594
Message ID:
01462595
Vues:
42
Did you add code to the cancel button's click method? The cancel code is already included in the mmButtonCancel class. If you added another cancel, you may be trying to cancel a non-existing row. (I just did this recently, thinking I just had an mmButton that I set up myself.)

>I am developing my first WinForms application with MM.Net. I am building a fairly standard maintenance form, following the directions given in the Dev Guide under "Creating a Maintenance Form". Things are working well, except when I try to Cancel a new entity.
>
>I click New, it switches to the Properties tab where I would fill out the Properties textboxes, I click Cancel, I get "Do you want to save changes?", I click No, then I get an Application Exception with a Description of "This row has been removed from a table and does not have any data. BeginEdit() will allow creation of new data in this row.". Stack trace at the end of this post.
>
>The odd thing is that if I click Yes, then it properly returns me to the List tab, with all data as it should be. What's going on? I am using 3.6 RTM, VS 2008, and no Entity Framework (stored proc for data access).
>
>
> at System.Data.DataRow.GetDefaultRecord()
> at System.Data.DataColumn.CheckMaxLength(DataRow dr)
> at System.Data.DataTable.RaiseRowChanging(DataRowChangeEventArgs args, DataRow eRow, DataRowAction eAction, Boolean fireEvent)
> at System.Data.DataTable.SetNewRecordWorker(DataRow row, Int32 proposedRecord, DataRowAction action, Boolean isInMerge, Int32 position, Boolean fireEvent, Exception& deferredException)
> at System.Data.DataTable.SetNewRecord(DataRow row, Int32 proposedRecord, DataRowAction action, Boolean isInMerge, Boolean fireEvent)
> at System.Data.DataRow.RejectChanges()
> at OakLeaf.MM.Main.Business.mmBusinessObjectHelperDS.CancelEntity[EntityType](EntityType entity, mmBusinessObjectGeneric`1 businessObject)
> at OakLeaf.MM.Main.Business.mmBusinessObjectGeneric`1.CancelEntity(EntityType entity)
> at OakLeaf.MM.Main.Business.mmBusinessObjectHelperDS.CancelEntityList[EntityType](mmBindingList`1 entityList, mmBusinessObjectGeneric`1 businessObject)
> at OakLeaf.MM.Main.Business.mmBusinessObjectGeneric`1.CancelEntityList(mmBindingList`1 entityList)
> at OakLeaf.MM.Main.Business.mmBusinessObjectGeneric`1.CancelEntityList()
> at OakLeaf.MM.Main.Windows.Forms.mmEntityBusinessForm.CancelEntityList(mmBusinessObject businessObject)
> at OakLeaf.MM.Main.Windows.Forms.mmButtonHelper.CancelHandler(Object button, String bindingSource, String bindingSourceMember, mmBaseBusinessObject& bizObj)
> at OakLeaf.MM.Main.Windows.Forms.mmButtonCancel.mmButtonCancel_Click(Object sender, EventArgs e)
> at System.EventHandler.Invoke(Object sender, EventArgs e)
> at System.Windows.Forms.Control.OnClick(EventArgs e)
> at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
> at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
> at System.Windows.Forms.Control.WndProc(Message& m)
> at System.Windows.Forms.ButtonBase.WndProc(Message& m)
> at System.Windows.Forms.Button.WndProc(Message& m)
> at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
> at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
> at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
> at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
> at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
> at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
> at CBNOVA.CreditCard.UI.WinForms.AppMainEntry.Main() in C:\Users\SchmuckerA\Documents\Visual Studio 2008\Projects\CreditCard\CreditCardUIWinForms\Main.cs:line 43
Linda Harmes
HiBit Technologies, Inc.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform