i am trying to put the date from gridview into datetimepick.
this the error i got.
{"The string was not recognized as a valid DateTime. There is an unknown word starting at index 0."}
this the code is if you click the row it transfer the data in information field
private void dgvContList_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e)
{
this.dtpStart.Value = Convert.ToDateTime(dgvContList.SelectedRows[0].Cells[3].ToString());
this.dtpEnd.Value = Convert.ToDateTime(dgvContList.SelectedRows[0].Cells[4].ToString());
}

Ranjit PowarRank #553 · 4.4K reputationPosted Jan 16, 2016, 3:25 AM EST
this.dtpStart.Value=DateTime.ParseExact(dgvContList.SelectedRows[0].Cells[3].ToString(),"dd/MM/yyyy", CultureInfo.InvariantCulture);
If this help you select it as correct answer.
JomarMark Tamargo27 reputationPosted Jan 16, 2016, 7:57 PM EST