Live Chat Icon For mobile
Live Chat Icon

How to resolve the error message ‘Cannot implicitly convert type ‘string’ to ‘System.DateTime’ ‘ when using a DataReader

Platform: ASP.NET| Category: ADO.NET

Try

VB.NET


dim dt as DateTime = ctype( dr('hiredate').ToString(), DateTime)

C#


DateTime dt= ((DateTime) dr['hiredate']).ToString(); 

Share with

Share on twitter
Share on facebook
Share on linkedin

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.