I
ibiza
Hi all,
I'm using a business logic layer as described in this source code :
http://www.asp.net/QuickStart/util/...s\App_Code\AuthorsComponent.cs&lang=C#+Source
It works very well until I encountered a small problem recently. When
it is time to bind the data from the db to my class representing an
"author" (let's say, for simplicity), what about if my row["au_state"]
was instead : row["au_idstate"] and was returning a NULL value. In my
"Authors class", I'd represent the idstate with an integer instead of a
string. What must I do when I try to assign a null value to an integer
(more precisely, a float in my case) because for now, I get a nasty
error "conversion from type 'DBNull' to type 'float' is not valid.
Then in my gridview, I want to see a blank cell if my float var is
NULL; not a 0 or something else...
Thanks!
ibiza
I'm using a business logic layer as described in this source code :
http://www.asp.net/QuickStart/util/...s\App_Code\AuthorsComponent.cs&lang=C#+Source
It works very well until I encountered a small problem recently. When
it is time to bind the data from the db to my class representing an
"author" (let's say, for simplicity), what about if my row["au_state"]
was instead : row["au_idstate"] and was returning a NULL value. In my
"Authors class", I'd represent the idstate with an integer instead of a
string. What must I do when I try to assign a null value to an integer
(more precisely, a float in my case) because for now, I get a nasty
error "conversion from type 'DBNull' to type 'float' is not valid.
Then in my gridview, I want to see a blank cell if my float var is
NULL; not a 0 or something else...
Thanks!
ibiza