I am getting the below error while taking data from MS Access database using VB.Net windows application (Framework 4.8).
<code> System.InvalidCastException: 'Conversion from string "06/23/2016 06:04:39 PM" to type 'Date' is not valid.'
</code>
<code> System.InvalidCastException: 'Conversion from string "06/23/2016 06:04:39 PM" to type 'Date' is not valid.'
</code>
System.InvalidCastException: 'Conversion from string "06/23/2016 06:04:39 PM" to type 'Date' is not valid.'
Below is the code that I am using.
<code> menu.SubItems.Add(CDate(dr("Field1").ToString("MM/dd/yyyy hh:mm tt"))
</code>
<code> menu.SubItems.Add(CDate(dr("Field1").ToString("MM/dd/yyyy hh:mm tt"))
</code>
menu.SubItems.Add(CDate(dr("Field1").ToString("MM/dd/yyyy hh:mm tt"))
How to solve this ?