| | | StrataFrame User
       
Group: StrataFrame Users Last Login: Today @ 7:53:55 PM Posts: 391, Visits: 1,427 |
| 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) |
| | | | StrataFrame User
       
Group: StrataFrame Users Last Login: Today @ 7:53:55 PM Posts: 391, Visits: 1,427 |
| I tried to restore back those DLL, but it will crash VS, cause I am unable to open my project.
Please advice. URGENT!!! |
| | | | StrataFrame User
       
Group: StrataFrame Users Last Login: Today @ 7:53:55 PM Posts: 391, Visits: 1,427 |
| Hi,
Just to add on, 1.6.1 mentioned is refering to assemblies posted in forum as patch.
Thank you |
| | | | 
StrataFrame Developer

Group: StrataFrame Developers Last Login: Today @ 9:09:33 AM Posts: 2,661, Visits: 1,876 |
| | 1) Are you explicitly setting the value of the Recalled field to DBNull.Value in the SetDefaultValues()? 2) Are any of the other fields in the new row DBNull.Value also, or just the Recalled field? 3) Is it trying to cast a DBNull.Value to a Boolean, or something else?
www.bungie.net |
| | | | StrataFrame User
       
Group: StrataFrame Users Last Login: Today @ 7:53:55 PM Posts: 391, Visits: 1,427 |
| Hi,
1) Are you explicitly setting the value of the Recalled field to DBNull.Value in the SetDefaultValues()?
No, I doesn't set DBNull.Value to recalled field. Beside, the error occurred BEFORE SetDefaultValues event fired.
2) Are any of the other fields in the new row DBNull.Value also, or just the Recalled field?
It happen to ALL fields.
3) Is it trying to cast a DBNull.Value to a Boolean, or something else?
To Boolean. The same problem happen to other fields as well, which is integer.
Please advice. It is urgent.
Thank you
|
| | | | 
StrataFrame Developer

Group: StrataFrame Developers Last Login: Today @ 9:09:33 AM Posts: 2,661, Visits: 1,876 |
| Is there more to the stack trace, or is what you posted in the first post all of it? I'm wondering if we could get back to what is causing the binding to update immediately after you add the new row... the binding shouldn't be updating until after all of the values are initialized and the SetDefaultValues() is called.
www.bungie.net |
| | | | StrataFrame User
       
Group: StrataFrame Users Last Login: Today @ 7:53:55 PM Posts: 391, Visits: 1,427 |
| Hi,
>InventoryBusinessObject.dll!JK.Inventory.Product.BusinessObject.ItemsBO.CategoryID.get() Line 452 + 0x2e bytesC#
InventoryBusinessObject.dll!JK.Inventory.Product.BusinessObject.ItemsBO.Field_CategoryID_Descriptor.GetValue(object component = {JK.Inventory.Product.BusinessObject.ItemsBO}) Line 1841 + 0x29 bytesC#
[External Code]
InventoryApplication.exe!JK.Inventory.Application.AppMain.Main() Line 45 + 0x6 bytesC#
[External Code]
I checked my code again, and found that as you suspected it might be caused by data binding. It works fine If I just
ItemsBO loBO = new ItemsBO();
loBO.Add();
In my project, the error happen at least two fields which :-
1. Bind to SF's check box
2. Custom lookup control inherited from DevExpress lookupedit.
How should I check next? |
| | | | StrataFrame User
       
Group: StrataFrame Users Last Login: Today @ 7:53:55 PM Posts: 391, Visits: 1,427 |
| Hi.
Just curious, any ideas why didn't the error happen in prior version? Anything changed? |
| | | | StrataFrame User
       
Group: StrataFrame Users Last Login: Today @ 7:53:55 PM Posts: 391, Visits: 1,427 |
| Hi,
Any possible to get the full source code for 1.6.1 (as posted at forum) so that I could debug?
You helps are much appreciated.
Thank you |
| |
|
|