Using string.IsNullOrEmpty will help check if there is any text. you can even use .Trim()
DateTime dateFrom;
if (string.IsNullOrEmpty(tb_DateFrom.Text.Trim()))
{
msg1 += "Date From cannot be blank! <br />";
}
else
{
string dateFromformat = "dd/MM/yyyy";
dateFrom = DateTime.ParseExact(tb_DateFrom.Text, dateFromformat, CultureInfo.InvariantCulture);
}
you can also use DateTime.TryParse(dateString, out convertDateTime);