I have an update function which writes the new Datetime value in the database by taking the string text, now there is a confusion.Do I need to convert the string initially or we convert the date time when we update as initially the display is in the text format. The code shows an exception:Initially when we display:\[code\]Actiontxt.Text = obj.ActionDate != null ? obj.ActionDate.ToString(): String.Empty;\[/code\]Now fro updating:\[code\]protected void SaveBtn_Click(object sender, EventArgs e){ obj.ActionDate = Convert.ToDateTime(Actiontxt.Text);}\[/code\]