I must have a culture which has date format like this dd.mm.yyyy , but when i forward it to row filter like this:
myTable.DefaultView.RowFilter="opened_on=#"+datetimepicker1.value.ToShortDateString()+"#"
It says that input string is not in valid DateTime format.
When user has culture with dd/mm/yyyy format without . it works perfectly.
Anybody knows why?
When you want to filter rows of a DataTable using the DefaultView.RowFilter property on a DateTime column, you should always use the general format of the invariant culture. (MM/dd/yyyy) as explained in MSDN for the Expression property from the DataColumn class
This could easily verified with something like this