SubbuUSA
asked on
Null handling in C#
Friends,
I have a problem. My stored procedure produces an integer values which I am assigning to an Nullable integer variable.
Dataclass where I call my Stored proc
------------
//Typecasting error happens here . Unable to cast from object to integer datatype
userProfile.NS_ID = Convert.ToInt32(dr.ItemArr ay[41]);
userprofile class
------------
public int? NMLS_ID
{
get;
set;
}
NS_ID is should get an integer..based on which I do my own business logic. but it is expected that 99% of time ..my stored proc would be producing a null because my db is fresh and users have not started using it.
How do i handle this.
REgards
Subbu
I have a problem. My stored procedure produces an integer values which I am assigning to an Nullable integer variable.
Dataclass where I call my Stored proc
------------
//Typecasting error happens here . Unable to cast from object to integer datatype
userProfile.NS_ID = Convert.ToInt32(dr.ItemArr
userprofile class
------------
public int? NMLS_ID
{
get;
set;
}
NS_ID is should get an integer..based on which I do my own business logic. but it is expected that 99% of time ..my stored proc would be producing a null because my db is fresh and users have not started using it.
How do i handle this.
REgards
Subbu
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER