5
Reply

Date Formatting

sdnaffi

sdnaffi

Feb 17 2005 7:22 AM
2.6k
Hey I tried this, private void ReceiptDateFormat(object sender, ConvertEventArgs c) { try { DateTime dt = (DateTime)c.Value; c.Value = dt.ToString("dd/MM/yyyy"); } catch(Exception ex) { MessageBox.Show("Error #: " + ", " + ex.Message,Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error); } } This gives an error saying InvalidCastingException Solve this pls

Answers (5)