Problem after upgrade to 1.6.1


Author
Message
Chan
Chan
Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)
Group: Forum Members
Posts: 533, Visits: 2K
Hi,

I am facing problem after upgrade 1.6.1. Now, whenever I click new button, I will hit error below even though I have set AllowNullValueOnNewRow = false. Before this, everything just working fine. Any ideas?



System.InvalidCastException was unhandled by user code

Message="Specified cast is not valid."

Source="InventoryBusinessObject"

StackTrace:

at JK.Inventory.Product.BusinessObject.ItemsBO.get_Recalled() in F:\Projects\Inventory\InventoryBusinessObject\Product\ItemsBO.Designer.cs:line 980

at JK.Inventory.Product.BusinessObject.ItemsBO.Field_Recalled_Descriptor.GetValue(Object component) in F:\Projects\Inventory\InventoryBusinessObject\Product\ItemsBO.Designer.cs:line 2545

at System.Windows.Forms.BindToObject.GetValue()

at System.Windows.Forms.Binding.PushData(Boolean force)

Replies
Chan
Chan
Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)
Group: Forum Members
Posts: 533, Visits: 2K
Hi,

The problem just gone after I upgrade to VS 2008. Strange.



However, I hit stackoverflow exception.



   MicroFour StrataFrame Business.dll!MicroFour.StrataFrame.Business.BusinessLayer.CurrentView_ListChanged(Object sender = {System.Data.DataView}, System.ComponentModel.ListChangedEventArgs e = {System.ComponentModel.ListChangedEventArgs}) Line 2417 + 0x3b bytes   Basic

   [Native to Managed Transition]   

   [Managed to Native Transition]   

   System.Data.dll!System.Data.DataView.OnListChanged(System.ComponentModel.ListChangedEventArgs e = {System.ComponentModel.ListChangedEventArgs}) + 0x10e bytes   

   System.Data.dll!System.Data.DataView.IndexListChanged(object sender, System.ComponentModel.ListChangedEventArgs e = {System.ComponentModel.ListChangedEventArgs}) + 0x1a bytes   

   System.Data.dll!System.Data.DataView.IndexListChangedInternal(System.ComponentModel.ListChangedEventArgs e) + 0x4b bytes   

   System.Data.dll!System.Data.DataViewListener.IndexListChanged(System.ComponentModel.ListChangedEventArgs e) + 0x3c bytes   

   System.Data.dll!System.Data.Index.OnListChanged.AnonymousMethod(System.Data.DataViewListener listener, System.ComponentModel.ListChangedEventArgs args, bool arg2, bool arg3) + 0x7 bytes   

   System.Data.dll!System.Data.Listeners.Notify(System.ComponentModel.ListChangedEventArgs arg1 = {System.ComponentModel.ListChangedEventArgs}, bool arg2 = false, bool arg3 = false, System.Data.Listeners.Action action = {Method = Cannot evaluate expression because the current thread is in a stack overflow state.}) + 0x75 bytes   

   System.Data.dll!System.Data.Index.OnListChanged(System.ComponentModel.ListChangedEventArgs e) + 0x9b bytes   

   System.Data.dll!System.Data.Index.RecordStateChanged(int oldRecord, System.Data.DataViewRowState oldOldState, System.Data.DataViewRowState oldNewState, int newRecord, System.Data.DataViewRowState newOldState, System.Data.DataViewRowState newNewState) + 0xfa bytes   

   System.Data.dll!System.Data.DataTable.RecordStateChanged(int record1 = 294, System.Data.DataViewRowState oldState1 = Added, System.Data.DataViewRowState newState1 = None, int record2 = 295, System.Data.DataViewRowState oldState2 = None, System.Data.DataViewRowState newState2 = Added) + 0x7f bytes   

   System.Data.dll!System.Data.DataTable.SetNewRecordWorker(System.Data.DataRow row = {System.Data.DataRow}, int proposedRecord, System.Data.DataRowAction action = Change, bool isInMerge, int position, bool fireEvent = true, out System.Exception deferredException = null) + 0x29d bytes   

   System.Data.dll!System.Data.DataTable.SetNewRecord(System.Data.DataRow row, int proposedRecord, System.Data.DataRowAction action, bool isInMerge, bool fireEvent) + 0x3d bytes   

   System.Data.dll!System.Data.DataRow.EndEdit() + 0x48 bytes   

   System.Data.dll!System.Data.DataRow.this[System.Data.DataColumn].set(System.Data.DataColumn column, object value) + 0xe4 bytes   

   System.Data.dll!System.Data.DataRow.this[string].set(string columnName, object value) + 0x19 bytes   

   InventoryBusinessObject.dll!JK.Inventory.Purchasing.BusinessObject.ReturnNotesBO.VendorID.set(System.Guid value = {System.Guid}) Line 452 + 0x43 bytes   C#

   InventoryBusinessObject.dll!JK.Inventory.Purchasing.BusinessObject.ReturnNotesBO.Field_VendorID_Descriptor.SetValue(object component = {JK.Inventory.Purchasing.BusinessObject.ReturnNotesBO}, object Value = {System.Guid}) Line 1217 + 0x5b bytes   C#

   System.Windows.Forms.dll!System.Windows.Forms.BindToObject.SetValue(object value) + 0x58 bytes   

   System.Windows.Forms.dll!System.Windows.Forms.Binding.PullData(bool reformat, bool force) + 0x14f bytes   

   System.Windows.Forms.dll!System.Windows.Forms.Binding.Target_PropertyChanged(object sender, System.EventArgs e) + 0x28 bytes   

   [Native to Managed Transition]   

   [Managed to Native Transition]   

   System.dll!System.ComponentModel.PropertyDescriptor.OnValueChanged(object component, System.EventArgs e) + 0x4c bytes   

   System.dll!System.ComponentModel.ReflectPropertyDescriptor.OnValueChanged(object component, System.EventArgs e) + 0x72 bytes   

   System.dll!System.ComponentModel.ReflectPropertyDescriptor.OnINotifyPropertyChanged(object component, System.ComponentModel.PropertyChangedEventArgs e) + 0x75 bytes   

   JK Framework Inherited UI.dll!JK.Framework.UI.Windows.Forms.DevEx.LookupEdit.FirePropertyChanged(string propertyName = "SelectedValue") Line 914 + 0x29 bytes   C#

   JK Framework Inherited UI.dll!JK.Framework.UI.Windows.Forms.DevEx.LookupEdit.SelectedValueChanged() Line 920 + 0xd bytes   C#

   JK Framework Inherited UI.dll!JK.Framework.UI.Windows.Forms.DevEx.LookupEdit.SelectedValue.set(object value = {System.Guid}) Line 802 + 0x7 bytes   C#

   [Native to Managed Transition]   

   [Managed to Native Transition]   

   System.dll!System.ComponentModel.ReflectPropertyDescriptor.SetValue(object component = {JK.Framework.UI.Windows.Forms.DevEx.EnhancedLookupEdit}, object value = {System.Guid}) + 0xe3 bytes   

   System.Windows.Forms.dll!System.Windows.Forms.Binding.SetPropValue(object value) + 0xc9 bytes   

   System.Windows.Forms.dll!System.Windows.Forms.Binding.PushData(bool force) + 0x71 bytes   

   System.Windows.Forms.dll!System.Windows.Forms.BindingManagerBase.PushData(out bool success = true) + 0x50 bytes   

   System.Windows.Forms.dll!System.Windows.Forms.BindingManagerBase.PushData() + 0xe bytes   

   System.Windows.Forms.dll!System.Windows.Forms.PropertyManager.OnCurrentChanged(System.EventArgs ea = {System.EventArgs}) + 0xd bytes   

   System.Windows.Forms.dll!System.Windows.Forms.BindToObject.PropValueChanged(object sender, System.EventArgs e) + 0x23 bytes   

   [Native to Managed Transition]   

   [Managed to Native Transition]   

   MicroFour StrataFrame Business.dll!MicroFour.StrataFrame.Business.BusinessLayer.CurrentView_ListChanged(Object sender = {System.Data.DataView}, System.ComponentModel.ListChangedEventArgs e = {System.ComponentModel.ListChangedEventArgs}) Line 2417 + 0x3b bytes   Basic

   [Native to Managed Transition]   

   [Managed to Native Transition]   

   System.Data.dll!System.Data.DataView.OnListChanged(System.ComponentModel.ListChangedEventArgs e = {System.ComponentModel.ListChangedEventArgs}) + 0x10e bytes   

   System.Data.dll!System.Data.DataView.IndexListChanged(object sender, System.ComponentModel.ListChangedEventArgs e = {System.ComponentModel.ListChangedEventArgs}) + 0x1a bytes   

   System.Data.dll!System.Data.DataView.IndexListChangedInternal(System.ComponentModel.ListChangedEventArgs e) + 0x4b bytes   

   System.Data.dll!System.Data.DataViewListener.IndexListChanged(System.ComponentModel.ListChangedEventArgs e) + 0x3c bytes   

   System.Data.dll!System.Data.Index.OnListChanged.AnonymousMethod(System.Data.DataViewListener listener, System.ComponentModel.ListChangedEventArgs args, bool arg2, bool arg3) + 0x7 bytes   

   System.Data.dll!System.Data.Listeners.Notify(System.ComponentModel.ListChangedEventArgs arg1 = {System.ComponentModel.ListChangedEventArgs}, bool arg2 = false, bool arg3 = false, System.Data.Listeners.Action action = {Method = Cannot evaluate expression because the current thread is in a stack overflow state.}) + 0x75 bytes   

   System.Data.dll!System.Data.Index.OnListChanged(System.ComponentModel.ListChangedEventArgs e) + 0x9b bytes   

   System.Data.dll!System.Data.Index.RecordStateChanged(int oldRecord, System.Data.DataViewRowState oldOldState, System.Data.DataViewRowState oldNewState, int newRecord, System.Data.DataViewRowState newOldState, System.Data.DataViewRowState newNewState) + 0xfa bytes   

   System.Data.dll!System.Data.DataTable.RecordStateChanged(int record1 = 293, System.Data.DataViewRowState oldState1 = Added, System.Data.DataViewRowState newState1 = None, int record2 = 294, System.Data.DataViewRowState oldState2 = None, System.Data.DataViewRowState newState2 = Added) + 0x7f bytes   

   System.Data.dll!System.Data.DataTable.SetNewRecordWorker(System.Data.DataRow row = {System.Data.DataRow}, int proposedRecord, System.Data.DataRowAction action = Change, bool isInMerge, int position, bool fireEvent = true, out System.Exception deferredException = null) + 0x29d bytes   

   System.Data.dll!System.Data.DataTable.SetNewRecord(System.Data.DataRow row, int proposedRecord, System.Data.DataRowAction action, bool isInMerge, bool fireEvent) + 0x3d bytes   

   System.Data.dll!System.Data.DataRow.EndEdit() + 0x48 bytes   

   System.Data.dll!System.Data.DataRow.this[System.Data.DataColumn].set(System.Data.DataColumn column, object value) + 0xe4 bytes   

   System.Data.dll!System.Data.DataRow.this[string].set(string columnName, object value) + 0x19 bytes   

   InventoryBusinessObject.dll!JK.Inventory.Purchasing.BusinessObject.ReturnNotesBO.VendorID.set(System.Guid value = {System.Guid}) Line 452 + 0x43 bytes   C#

   InventoryBusinessObject.dll!JK.Inventory.Purchasing.BusinessObject.ReturnNotesBO.Field_VendorID_Descriptor.SetValue(object component = {JK.Inventory.Purchasing.BusinessObject.ReturnNotesBO}, object Value = {System.Guid}) Line 1217 + 0x5b bytes   C#

   System.Windows.Forms.dll!System.Windows.Forms.BindToObject.SetValue(object value) + 0x58 bytes   

   System.Windows.Forms.dll!System.Windows.Forms.Binding.PullData(bool reformat, bool force) + 0x14f bytes   

   System.Windows.Forms.dll!System.Windows.Forms.Binding.Target_PropertyChanged(object sender, System.EventArgs e) + 0x28 bytes   

   [Native to Managed Transition]   

   [Managed to Native Transition]   

   System.dll!System.ComponentModel.PropertyDescriptor.OnValueChanged(object component, System.EventArgs e) + 0x4c bytes   

   System.dll!System.ComponentModel.ReflectPropertyDescriptor.OnValueChanged(object component, System.EventArgs e) + 0x72 bytes   

   System.dll!System.ComponentModel.ReflectPropertyDescriptor.OnINotifyPropertyChanged(object component, System.ComponentModel.PropertyChangedEventArgs e) + 0x75 bytes   

>   JK Framework Inherited UI.dll!JK.Framework.UI.Windows.Forms.DevEx.LookupEdit.FirePropertyChanged(string propertyName = "SelectedValue") Line 914 + 0x29 bytes   C#

   JK Framework Inherited UI.dll!JK.Framework.UI.Windows.Forms.DevEx.LookupEdit.SelectedValueChanged() Line 920 + 0xd bytes   C#

   JK Framework Inherited UI.dll!JK.Framework.UI.Windows.Forms.DevEx.LookupEdit.SelectedValue.set(object value = {System.Guid}) Line 802 + 0x7 bytes   C#

   [Native to Managed Transition]   

   [Managed to Native Transition]   

   System.dll!System.ComponentModel.ReflectPropertyDescriptor.SetValue(object component = {JK.Framework.UI.Windows.Forms.DevEx.EnhancedLookupEdit}, object value = {System.Guid}) + 0xe3 bytes   

   System.Windows.Forms.dll!System.Windows.Forms.Binding.SetPropValue(object value) + 0xc9 bytes   

   System.Windows.Forms.dll!System.Windows.Forms.Binding.PushData(bool force) + 0x71 bytes   

   System.Windows.Forms.dll!System.Windows.Forms.BindingManagerBase.PushData(out bool success = true) + 0x50 bytes   

   System.Windows.Forms.dll!System.Windows.Forms.BindingManagerBase.PushData() + 0xe bytes   

   System.Windows.Forms.dll!System.Windows.Forms.PropertyManager.OnCurrentChanged(System.EventArgs ea = {System.EventArgs}) + 0xd bytes   

   System.Windows.Forms.dll!System.Windows.Forms.BindToObject.PropValueChanged(object sender, System.EventArgs e) + 0x23 bytes   

   [Native to Managed Transition]   

   [Managed to Native Transition]   

   MicroFour StrataFrame Business.dll!MicroFour.StrataFrame.Business.BusinessLayer.CurrentView_ListChanged(Object sender = {System.Data.DataView}, System.ComponentModel.ListChangedEventArgs e = {System.ComponentModel.ListChangedEventArgs}) Line 2417 + 0x3b bytes   Basic

   [Native to Managed Transition]   

   [Managed to Native Transition]   

   System.Data.dll!System.Data.DataView.OnListChanged(System.ComponentModel.ListChangedEventArgs e = {System.ComponentModel.ListChangedEventArgs}) + 0x10e bytes   

   System.Data.dll!System.Data.DataView.IndexListChanged(object sender, System.ComponentModel.ListChangedEventArgs e = {System.ComponentModel.ListChangedEventArgs}) + 0x1a bytes   

   System.Data.dll!System.Data.DataView.IndexListChangedInternal(System.ComponentModel.ListChangedEventArgs e) + 0x4b bytes   

   System.Data.dll!System.Data.DataViewListener.IndexListChanged(System.ComponentModel.ListChangedEventArgs e) + 0x3c bytes   

   System.Data.dll!System.Data.Index.OnListChanged.AnonymousMethod(System.Data.DataViewListener listener, System.ComponentModel.ListChangedEventArgs args, bool arg2, bool arg3) + 0x7 bytes   

   System.Data.dll!System.Data.Listeners.Notify(System.ComponentModel.ListChangedEventArgs arg1 = {System.ComponentModel.ListChangedEventArgs}, bool arg2 = false, bool arg3 = false, System.Data.Listeners.Action action = {Method = Cannot evaluate expression because the current thread is in a stack overflow state.}) + 0x75 bytes   

   System.Data.dll!System.Data.Index.OnListChanged(System.ComponentModel.ListChangedEventArgs e) + 0x9b bytes   

   System.Data.dll!System.Data.Index.RecordStateChanged(int oldRecord, System.Data.DataViewRowState oldOldState, System.Data.DataViewRowState oldNewState, int newRecord, System.Data.DataViewRowState newOldState, System.Data.DataViewRowState newNewState) + 0xfa bytes   

   System.Data.dll!System.Data.DataTable.RecordStateChanged(int record1 = 292, System.Data.DataViewRowState oldState1 = Added, System.Data.DataViewRowState newState1 = None, int record2 = 293, System.Data.DataViewRowState oldState2 = None, System.Data.DataViewRowState newState2 = Added) + 0x7f bytes   

   System.Data.dll!System.Data.DataTable.SetNewRecordWorker(System.Data.DataRow row = {System.Data.DataRow}, int proposedRecord, System.Data.DataRowAction action = Change, bool isInMerge, int position, bool fireEvent = true, out System.Exception deferredException = null) + 0x29d bytes   

   System.Data.dll!System.Data.DataTable.SetNewRecord(System.Data.DataRow row, int proposedRecord, System.Data.DataRowAction action, bool isInMerge, bool fireEvent) + 0x3d bytes   





Below is my code for INotifyPropertyChanged



#region INotifyPropertyChanged Members



public event PropertyChangedEventHandler PropertyChanged;



protected bool CheckPropertyChanged(string propertyName, ref T oldValue, ref T newValue)

{

if (oldValue == null && newValue == null)

{

return false;

}



if ((oldValue == null && newValue != null) || !oldValue.Equals((T)newValue))

{

oldValue = newValue;



FirePropertyChanged(propertyName);



return true;

}



return false;

}



protected void FirePropertyChanged(string propertyName)

{

if (this.PropertyChanged != null)

{

this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));

}

}



protected void SelectedValueChanged()

{

FirePropertyChanged("SelectedValue");

}



#endregion





Please advice.



Thank you
Chan
Chan
Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)
Group: Forum Members
Posts: 533, Visits: 2K
Hi,

Just to summary the call stack posted in previous message.



I found that, once I assign value to Vendor property (internally CurrentRow["VendorID"]), it cause BusinessLayer.CurrentView_ListChanged fired. It cause .NET BindingManagerBase try to push data back to binded property. It cause recurring cycle.



Any ideas?



Thank you
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Chan,

The ListChanged event has not changed between the releases.  First, instead of me trying to disesct a piece of your code from above, it would be better if you could recreate this in a quick sample so I can debug this to tell you where your issue resides.  You mentioned that you have implemented the INotifyPropertyChanged event (which I think is the source of this particular problem) but where did you implement this?  I think that your implementation is raising the changed event prior to SF which could be causing the problem (an initialization issue).  Instead of posting all of the stack trace, I really need more detail about your code, where you are implementhing this logic, and get in a reproducable sample.  We have not encountered this type of behaviour anywhere else, so I think this is specific to your code.  Any additional details would be helpful.  Thanks.

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Chan - 17 Years Ago
Chan - 17 Years Ago
Chan - 17 Years Ago
StrataFrame Team - 17 Years Ago
                     Hi,

1) Are you explicitly setting the value of the Recalled...
Chan - 17 Years Ago
                         Is there more to the stack trace, or is what you posted in the first...
StrataFrame Team - 17 Years Ago
                             Hi,
...
Chan - 17 Years Ago
                             Hi.
Just curious, any ideas why didn't the error happen in prior...
Chan - 17 Years Ago
                             Hi,
Any possible to get the full source code for 1.6.1 (as posted...
Chan - 17 Years Ago
                             Hi,
I have successfully reverted back all SF assemblies. And now...
Chan - 17 Years Ago
                                 Chan, There is no reason that we could not publish this code. I need...
Trent L. Taylor - 17 Years Ago
                                     OK...if you login to the My Account area, you should be able to see...
Trent L. Taylor - 17 Years Ago
                                         Hi,
Thank you for source code.

I have recompile SF and...
Chan - 17 Years Ago
                                             Hi,
Below is another call stack which is NOT using...
Chan - 17 Years Ago
                                             Is the SubTotal property of the BO returning a null value? I've had...
Bill Cunnien - 17 Years Ago
                                                 Hi,
Yes, SubTotal property is null when...
Chan - 17 Years Ago
                                                     [quote][b]Chan (01/24/2008)[/b][hr] Any ideas to solve it? Is it a...
Bill Cunnien - 17 Years Ago
                                                         Hi,
The problem just gone after I upgrade to VS 2008. Strange....
Chan - 17 Years Ago
                                                             Hi,
Just to summary the call stack posted in previous message....
Chan - 17 Years Ago
                                                                 Chan, The ListChanged event has not changed between the releases....
Trent L. Taylor - 17 Years Ago
Chan - 17 Years Ago
StrataFrame Team - 17 Years Ago
Trent L. Taylor - 17 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search