title: Date field is not getting null from GridView
body: <p>I have developed ASP.net page with C# and oracle 11g. I am updating database table from GridView. But whenever I try to null the date cell getting this error</p>
  
  <p>"String was not recognized as a valid DateTime."
  Scan Date data stored in database(oracle 11g) with date as well as time. (i.e. 05-07-2015 PM 05:21:15)</p>
  
  <p>Please refer below code :-</p>
  
  <pre><code>protected void grv_pallet_RowUpdating(object sender, GridViewUpdateEventArgs e)
  {
  TextBox txt_reswt = (TextBox)grv_pallet.Rows[e.RowIndex].FindControl("txt_reswt");
  TextBox txt_rackno = (TextBox)grv_pallet.Rows[e.RowIndex].FindControl("txt_rackno");
  TextBox txt_whcd = (TextBox)grv_pallet.Rows[e.RowIndex].FindControl("txt_whcd");
  TextBox txt_dtsts = (TextBox)grv_pallet.Rows[e.RowIndex].FindControl("txt_dtsts");
  TextBox txt_scandt = (TextBox)grv_pallet.Rows[e.RowIndex].FindControl("txt_scandt");
  
  
  string str1 = "UPDATE WI_PALLET SET RES_WT = :reswt, RACK_NO = :rackno, WH_CD = :whcd, DATA_STS = :datasts, SCAN_DT = :scandt WHERE PALLET_NO = '" + grv_pallet.DataKeys[e.RowIndex].Values[0].ToString() + "'";
  
  
  con.Open();
  OracleCommand cmd = new OracleCommand(str1, con);
  
  cmd.Parameters.AddWithValue("reswt", txt_reswt.Text);
  cmd.Parameters.AddWithValue("rackno", txt_rackno.Text);
  cmd.Parameters.AddWithValue("whcd", txt_whcd.Text);
  cmd.Parameters.AddWithValue("datasts", txt_dtsts.Text);
  cmd.Parameters.AddWithValue("scandt", Convert.ToDatetime(txt_scandt.Text));
  
  cmd.ExecuteNonQuery();
  grv_pallet.EditIndex = -1;
  con.Close();
  string display = "Database Updated Successfully..!!";
  ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + display + "');", true);
  }
  </code></pre>