Browser Dialog error with DateTime fields range


Author
Message
Edhy Rijo
E
StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi,

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:

ArgumentException
  An item with the same key has already been added.

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?

Edhy Rijo

Replies
Edhy Rijo
E
StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Trent,

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:

  • >= SF modify the time part to be 12:00 AM
  • <= SF modify the time part to be 11:59:29 PM

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!

Edhy Rijo

Edhy Rijo
E
StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Trent, Ben,

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.

Thanks!

Edhy Rijo

Edhy Rijo
E
StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Trent, Ben,

Well, there is not need to answer my previous request w00t

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.Tongue

Edhy Rijo

Ivan George Borges
Ivan George Borges
Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
... you guys took me by surprise, I almost have a heart attach, when I saw the details for the update.

I would advice them to take a bit longer next time, and give you the news slower, in parts... Tongue

Seriously, now, I agree with you, it was an amazing work! As usual...

Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
I wasn't try to give anyone Cardiac Arrest Smile  I just knew that we have a number of people that were needing some enhancements so while I was in there, I made every change that was on my list.  Glad it got you what you needed Smile
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Edhy Rijo - 18 Years Ago
StrataFrame Team - 18 Years Ago
Edhy Rijo - 18 Years Ago
                 Hehe, nope, I just looked right past it... sorry.
StrataFrame Team - 18 Years Ago
StrataFrame Team - 18 Years Ago
                         Hi Ben, Thanks for the zip file, the new dlls fixed the exception...
Edhy Rijo - 18 Years Ago
                             [quote][b]Edhy Rijo (10/16/2007)[/b][hr]Hi Ben, Thanks for the zip...
Edhy Rijo - 18 Years Ago
                                 Edhy, I think I know what is going on here. If you change the ending...
Trent L. Taylor - 18 Years Ago
                                     [quote][b]Trent L. Taylor (10/19/2007)[/b][hr]There probably needs to...
Edhy Rijo - 18 Years Ago
                                         [quote]About the enhancement, I would prefer to deal only with the...
Trent L. Taylor - 18 Years Ago
                                             Hi Trent, Since when using a DateTime search field in the Browser...
Edhy Rijo - 18 Years Ago
                                                 Hi Trent, Ben, Is there any news on this issue? I really need to...
Edhy Rijo - 18 Years Ago
                                                     Hi Trent, Ben, Well, there is not need to answer my previous request...
Edhy Rijo - 18 Years Ago
                                                         [quote]... you guys took me by surprise, I almost have a heart attach,...
Ivan George Borges - 18 Years Ago
                                                             I wasn't try to give anyone Cardiac Arrest :) I just knew that we have...
Trent L. Taylor - 18 Years Ago
DanMetcalf - 17 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search