First of all declare :
STEP :1
object parameterValue;
then
if (!dr.IsNull("Exit_Date"))
{
parameterValue = ((DateTime)dr["Exit_Date"]).ToShortDateString();
}
else
{
parameterValue = DBNull.Value;
}
this will insert null value in database at datetime field if no value is entered
object parameterValue;
if (!dr.IsNull("Exit_Date"))
{
parameterValue = ((DateTime)dr["Exit_Date"]).ToShortDateString();
}
else
{
parameterValue = DBNull.Value;
}
STEP :1
object parameterValue;
then
if (!dr.IsNull("Exit_Date"))
{
parameterValue = ((DateTime)dr["Exit_Date"]).ToShortDateString();
}
else
{
parameterValue = DBNull.Value;
}
this will insert null value in database at datetime field if no value is entered
object parameterValue;
if (!dr.IsNull("Exit_Date"))
{
parameterValue = ((DateTime)dr["Exit_Date"]).ToShortDateString();
}
else
{
parameterValue = DBNull.Value;
}
0 comments:
Post a Comment