Handling null value


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

I have a table with 3 fields



Field Name Type ALlow NULL PK Indentity

---------------------------------------------------------------------

ID int No Yes Yes

Descr varchar(30) No No No

FKID int Yes No No







I set my BO to map to this table, set ID and Descr to Do Not Allow NULL; FKID to Use nullable generic in BO mapper allow null option. When I save new record, I found that FKID is always ZERO instead of NULL if I leave FKID blank (bound in combobox). I figured out that myBO.AllowNullValuesOnNewRow = false.



So, I try to set myBO.AllowNullValuesOnNewRow = true but then I will hit error complaint that system unable to convert DBNull to string for textbox. I was thinking to change "Descr" to use "Return alternate on null" option.



May I know is it the prefered way? Or, any recommendation?



Thank you
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search