Enum data type


Author
Message
kkchan
kkchan
StrataFrame Novice (96 reputation)StrataFrame Novice (96 reputation)StrataFrame Novice (96 reputation)StrataFrame Novice (96 reputation)StrataFrame Novice (96 reputation)StrataFrame Novice (96 reputation)StrataFrame Novice (96 reputation)StrataFrame Novice (96 reputation)StrataFrame Novice (96 reputation)
Group: Forum Members
Posts: 48, Visits: 97
Hi,

May I know what is the data type used by enum? I have a combobox that use enum as population. It hits error if I bind it to a integer field.



System.InvalidCastException was unhandled by user code

Message="Specified cast is not valid."

Source="InventoryBusinessObject"

StackTrace:

at JK.Inventory.BusinessObject.CompanyAddressBO.get_AddressTypeID() in F:\Projects\Inventory\InventoryBusinessObject\CompanyAddressBO.Designer.cs:line 321

at JK.Inventory.BusinessObject.CompanyAddressBO.Field_AddressTypeID_Descriptor.GetValue(Object component) in F:\Projects\Inventory\InventoryBusinessObject\CompanyAddressBO.Designer.cs:line 751

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

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


Attachments
enumerror.JPG (153 views, 61.00 KB)
Reply
kkchan
kkchan
StrataFrame Novice (96 reputation)StrataFrame Novice (96 reputation)StrataFrame Novice (96 reputation)StrataFrame Novice (96 reputation)StrataFrame Novice (96 reputation)StrataFrame Novice (96 reputation)StrataFrame Novice (96 reputation)StrataFrame Novice (96 reputation)StrataFrame Novice (96 reputation)
Group: Forum Members
Posts: 48, Visits: 97
Hi,

I moved enum to enumeration.cs and try again.. still the same.

FYI, I typed the code below in editor and VS.NET able to show me the enum list. But when I search enum from BO mapper custom data type search, it doesn't list anything. It just return what I type back to the column.



this.companyaddressbo.addresstypeID =



Really strange



BTW, my field is INT field type. Any impact?



GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
kkchan - 18 Years Ago
StrataFrame Team - 18 Years Ago
kkchan - 18 Years Ago
StrataFrame Team - 18 Years Ago
                     Hi,
I moved enum to enumeration.cs and try again.. still the...
kkchan - 18 Years Ago
                     Hi,
Sorry to trouble you again.
After some debugging, when I...
kkchan - 18 Years Ago
                         Hi,
Sorry, one more question here. I found that only integer...
kkchan - 18 Years Ago
                             When you add a new record, SF initializes all of the fields within the...
StrataFrame Team - 18 Years Ago
                                 Hi,
My enum do have 0 value

public enum myEnum...
kkchan - 18 Years Ago
                                     [quote] Hi, My enum do have 0 value public enum myEnum {Billing,...
StrataFrame Team - 18 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search