0

I have a problem displaying dates in rdlc reports using C#, the date came from sql server is DateTime type i.e 2013-06-25 02:30:00.000, but when displayed on report it formats according to local PC regional settings. I can't use CDate() to format it the way I want because it returns error, I tried to set Format property of the textBox to dd/MM/yyyy but nothing happened. It seems, it dealt with the date value as string.

How can I bypass the regional settings and let report viewer to deal with it as date not string?

Sazzadur Rahaman
  • 6,938
  • 1
  • 30
  • 52
Remad K
  • 1
  • 2
  • the problem was due to making the date field of type varchar in the dataset table used to put intermediate data in (not the actual table in database). Changing the data type to datetime solved the problem. – Remad K Jul 29 '13 at 12:37

1 Answers1

0

I don't think your problem has anything to do with your regional settings, it sounds like the report doesn't understand that the date field is actually a date.

Make sure that the date field in the dataset is of type System.DateTime

Jim Aho
  • 9,932
  • 15
  • 56
  • 87