Hello fellows, good day. I am using an OLEDB connection to connect to DB2 database. I am having problems mapping the dates from database inside .NET.
In my business object I defined a private DateTime _genftmdpdate=DateTime.MinValue;
But whenever I fetch the date from database and populate inside my variable I get Specified Cast not valid error
myftModInstall.genFtMDPDate = myRecord.GetDateTime(myRecord.GetOrdinal("GENFTMDPDATE"))
Please help me as I don't want to convert the date into string all the time.
Edit
--- This won't work as well myftModInstall.genFtMDPDate = Convert.ToDateTime(myRecord.GetType((System.Data.OleDb.OleDbType.Date)(myRecord.GetOrdinal("GENFTMDPDATE"))));