Click here to Skip to main content
15,913,610 members

Comments by rune711 (Top 3 by date)

rune711 28-Oct-12 19:02pm View    
Brilliant. My problem was that I would create an instance of the Widget and assign the image to the customImageViewer, which sometimes created a message. Meanwhile in the base class that created the widget the event handler wasn't assigned until AFTER the image was assigned to customImageViewer. When it ran, obviously sometimes the message didn't exist until AFTER the image was finished being assigned, thus the periodic issue. Now with the event handler assigned first, no problems. Thanks!
rune711 12-Feb-12 16:52pm View    
Success. At first I was going to comment that your suggestion wouldn't work because the EndDate object is by it's nature stored as a string in the database, but by inserting it using:

<pre lang="c#">cmd.Parameters.AddWithValue("@endDate", this.EndDate)</pre>

...appears to format it correctly to the format:

<pre>2012-06-11 15:41:56.2806071</pre>

This then correctly reads from the databse using:

<pre lang="c#">DateTime theDate = (DateTime)reader["endDate"];</pre>

Way easier anyway. You might notice that the format is different in regards to using "-" seperators instead of "/". I wonder if my old way would have worked had I parsed it like this? Regardless, this is much easier. Thanks for the assist!

Rune
rune711 15-Jan-12 22:37pm View    
One thought I have is that, if you have a single connection, and your application is multi-threaded, you might end up with conflicts fighting for use of the connection. I am assuming that using separate instances of the connection in each procedure would lessen this issue? (My program is multi-threaded).