Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Error when cancelling out of an edit form
Message
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Titre:
Error when cancelling out of an edit form
Versions des environnements
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01079652
Message ID:
01079652
Vues:
81
After upgrading to the current version MM.NET, we are getting the following error when calling the Cancel method of mmBusinessForm.
System.IndexOutOfRangeException was unhandled by user code
  Message="Index -1 does not have a value."
  Source="System.Windows.Forms"
  StackTrace:
       at System.Windows.Forms.CurrencyManager.get_Item(Int32 index)
       at System.Windows.Forms.CurrencyManager.get_Current()
       at OakLeaf.MM.Main.Windows.Forms.mmBusinessForm.GetCurrentRow(DataSet ds, String tableName)
       at OakLeaf.MM.Main.Windows.Forms.mmBusinessForm.Cancel(mmBusinessObject bizObj, String tableName)
       at CMS.Main.Windows.Forms.cmsBusinessForm.Cancel(mmBusinessObject bizObj, String tableName) in D:\cms\AA3\CMSWindowsForms\cmsBusinessForm.cs:line 193
       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.Windows.Forms.Control.OnClick(EventArgs e)
       at System.Windows.Forms.Button.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.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
It seems to error in the following code trying to find the binding context.
		/// <summary>
		/// Returns the current row of the specified DataSet and table
		/// </summary>
		/// <param name="ds">DataSet</param>
		/// <param name="tableName">Table Name</param>
		/// <returns>DataRowView of the current row</returns>
		public virtual DataRowView GetCurrentRow(DataSet ds, string tableName)
		{
			return (DataRowView)this.BindingContext[ds, tableName].Current;
		}
Any help would be appreciated.
Stephen Lee

--------------------------------
Too much to code
Too little time
--------------------------------
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform