The following check is needed to check for null values. is there a way i can do it directly?
if(node.ID==0)
{
cmd.Parameters["@ID"].Value = DBNull.Value;
}
else
{
cmd.Parameters["@ID"].Value = node.ID;
}
is there way we can cicumvent this check and a design by which we can avoid this repetitive check for each value? (by the way its just a logic that 0 to be interpreted as NULL for my case but am asking the same about nullable objects like string too)