My SQL Server database contains nullable DateTime values. How can I convert them to a nullable DateTime object in my application in C#?
This is what I would think it
DateTime? dt = null; if (sqldatareader[0] != System.DbNull.Value) { dt = (DateTime)sqldatareader[0]; }