StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      


123»»»

Problem after upgrade to 1.6.1Expand / Collapse
Author
Message
Posted 01/19/2008 7:02:23 PM
StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame 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)
Post #13577
Posted 01/19/2008 7:26:19 PM
StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame 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!!!
Post #13578
Posted 01/20/2008 4:56:38 AM
StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame 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
Post #13582
Posted 01/21/2008 8:45:32 AM


StrataFrame Developer

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
Post #13586
Posted 01/21/2008 9:04:29 AM
StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame 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

  Post Attachments 
NullValue.JPG (4 views, 148.78 KB)
Post #13589
Posted 01/21/2008 9:56:27 AM


StrataFrame Developer

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
Post #13592
Posted 01/21/2008 10:39:52 AM
StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame 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?
Post #13595
Posted 01/21/2008 10:42:45 AM
StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame 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?
Post #13596
Posted 01/21/2008 11:06:20 AM
StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame 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
Post #13597