这不起作用
string d = InvDate.ToString("dd/MM/yyyy h:mm:ss tt",CultureInfo.InvariantCulture).Trim();
sale_invoiceBindingSource.Filter = "InvDate = '"+d+"'";
但这有效
string d = InvDate.ToString("dd/MM/yyyy h:mm:ss tt",CultureInfo.InvariantCulture).Trim();
sale_invoiceBindingSource.Filter = "InvDate = '20/12/2013 10:45 PM'";
无法弄清楚问题是什么
答案 0 :(得分:0)
如果您的过滤器接受dd/MM/yyyy h:mm tt
格式的日期格式,则无需提供秒(ss
)
试试这个:
string d = InvDate.ToString("dd/MM/yyyy h:mm tt",CultureInfo.InvariantCulture).Trim();
sale_invoiceBindingSource.Filter = "InvDate = '"+d+"'";