C# – date is converted into datetime format when stored in datatable ado.net

cdatasetdatetime

I had written stored procedure which returns date only not datetime i.e

CurrentDate
2013-10-06

So when i stored this result in dataset using da.fill( ) method, there inside the datatable it is stored in the format datetime resulting as 2013-10-06 12:00:00

How to solve this problem?

Best Answer

Thank You all guys, finally i followed this approach

                foreach (DataRow dr in dt.Rows)
                {
                    dr["date"] = DateTime.Parse((dr["date"].ToString())).ToShortDateString();
                }

Which only returns date without time.