Srihari
Srihari

Reputation: 2429

How to store Date from C# to MS-Access and how to retrieve it?

I used dateEdit field to store date in my form. In Access Database it store as "07-01-2014" but When I try to retrieve it back to dateEdit field, it displaying "07-01-2014 AM 12:00:00". I dont need time. How to remove this time from dateEdit Field.

Upvotes: 0

Views: 424

Answers (3)

Srihari
Srihari

Reputation: 2429

Finally I solved that by simple changing DateTime datatype to string in both C# and MS-Access database. Now am getting Date only.

Upvotes: 0

Gord Thompson
Gord Thompson

Reputation: 123409

According to this thread in the DevExpress support forum the solution would be to set the DateEdit.Properties.Mask.UseMaskAsDisplayFormat property to True. For more information see

MaskProperties.UseMaskAsDisplayFormat Property

Upvotes: 2

ozz
ozz

Reputation: 45

For retrieve only date:

DateTime retDate= *retrieved date*;
string onlyDate = retDate.ToString("MM/dd/yyyy");

Upvotes: 1

Related Questions