I am trying to load some dates from a database, but i dont want to create a datetime object with time, i only want the date. I have tried with var date = value.Date; it doesn't work. I have seen a lot of methods that basically format the date to show it as a string and i don't want to do that, because than i have to load all the data into the grid manually. I hope someone can help me. Here is the code
DateTime startDate = (DateTime)row["Course_StartDate"]; DateTime endDate = (DateTime)row["Course_EndDate"];
DateTimeclass has a time property. There is no way to change that.DateTimebecause it always has a Date and a Time. usestartDate.Dateto work with just the date. Depending on whatthe gridis, you might also be able to enter a display style