G
Guest
hey all,
if (DataReader["ParentId"].ToString() != String.Empty)
{
oCategory.ParentId = Convert.ToInt32(DataReader["ParentId"]);
}
ParentId has some null values coming from my database. Is this the correct
way to handle the nulls for this field (or any field for that matter)?
When i debug, inside the immediate window i type:
?DataReader["ParentId"]
{ }
I'm not sure what the 2 braces mean so i added the ToString() and just
checked for " ".
One more thing, about the Convert.ToInt32 is this ok to use? Why isn't there
just a Convert.ToInteger?
thanks,
rodchar
if (DataReader["ParentId"].ToString() != String.Empty)
{
oCategory.ParentId = Convert.ToInt32(DataReader["ParentId"]);
}
ParentId has some null values coming from my database. Is this the correct
way to handle the nulls for this field (or any field for that matter)?
When i debug, inside the immediate window i type:
?DataReader["ParentId"]
{ }
I'm not sure what the 2 braces mean so i added the ToString() and just
checked for " ".
One more thing, about the Convert.ToInt32 is this ok to use? Why isn't there
just a Convert.ToInteger?
thanks,
rodchar