Can you get the if condition in a single line of code?
oa is a dataset.
ACQ_DATE is a column and it could be null.
Code:if (oa["ACQ_DATE"].ToString() == "")
{
PurchaseDt = DateTime.Now;
}
else
{
PurchaseDt = DateTime.ParseExact(oa["ACQ_DATE"].ToString(),"d",provider);
}

