Problem with condition statement in c#
<pre><code>if (txt_SendAt.Text != null)
{
    //string SendAt_date = txt_Respondby.Text;
    DateTime Send_date = Convert.ToDateTime(txt_SendAt.Text);

    param[15] = new MySqlParameter("@SendDate", MySqlDbType.DateTime);
    param[15].Value = Send_date;
    command.Parameters.AddWithValue("@SendDate", Send_date);     

}
else
{
    param[15] = new MySqlParameter("@SendDate", MySqlDbType.DateTime);
    param[15].Value = now;
    command.Parameters.AddWithValue("@SendDate", now);

}
</code></pre>

<p>I have a text box where i select date and time from a calender. When I leave the text box empty it should execute the statements in else condition but it executes the statement in if. Where am I going wrong</p>

<p>I am getting this error if i leave it blank String was not recognized as a valid DateTime.</p>
