I have a Browser Dialog in which I need to search on a DateTime field (using the date portion only) using a range condition >= and <=. I added the same field CallDateTime twice with the >= and <= condition (see attached image), and when doing the search I got the following error:
Source : mscorlib
Stack Trace: at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource) at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value) at MicroFour.StrataFrame.UI.Windows.Forms.BrowseDialogSearchingEventArgs..ctor(BrowseDialog Browse, WhereStatementCollection WhereStatements) at MicroFour.StrataFrame.UI.Windows.Forms.BrowseDialogwindow.ExecuteSearch() at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e) at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e) at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e) at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ToolStrip.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativewindow.WndProc(Message& m) at System.Windows.Forms.Nativewindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
As I understand, this error may be generated by adding the field twice in the browser dialog, so if this is the case, how can I handle a search on the CallDateTime field using a range date for the same field?
Since when using a DateTime search field in the Browser Dialog, it wll only show the Date part instead of the DateTime, could it be possible incorporate a quick fix like this:
When using the filter expression on a DateTime search field like:
This will produce the correct SQL statement needed by the Dialog Browser to get the correct records.
I truly believe that the way the DB works now with date should be doing something like this under the hook. Please consider this and let me know.
Thanks!
Is there any news on this issue?
I really need to have a Date range functionality in the Browser Dialog for this particular form.
The customer wants to be able to search for records and I need to provide him with an answer.
At this point I am open to any suggestion. The fields are DateTime, but in the Browser Dialog search I just need to use the date.
Well, there is not need to answer my previous request
I found the answer on this post: http://forum.strataframe.net/Topic12630-22-1.aspx and I you guys took me by surprise, I almost have a heart attach, when I saw the details for the update.
Thanks a lot for such a response.
I would advice them to take a bit longer next time, and give you the news slower, in parts...
Seriously, now, I agree with you, it was an amazing work! As usual...