Click here to Skip to main content
15,845,103 members

Comments by Jason Gleim (Top 138 by date)

Jason Gleim 20-Mar-19 16:40pm View    
You should not use buttons to manage the state. When a button isn't visible on screen it isn't updated. So you are tying to set properties on an object which isn't visible... that won't do anything.

You need to manage your state with an object. Update the state in the click handlers then reflect that back out to the buttons. However, you don't say if you are using winforms or xaml for the UI. You may also run into a situation where you can't update the button state from inside the event handler. There are rules around that like you can't raise an event which results in UI changes from inside the event handler for an event surfaced by the UI. You have to decouple one event from another using a timer or a storyboard or something like that which allows the UI thread to exit the current event handler before entering a new one.

The best approach would be data binding the buttons back to a global state object that implements INotifyPropertyChanged. That's easy to do in xaml but much more difficult in Winforms.
Jason Gleim 20-Mar-19 16:26pm View    
Did you look on their web site and see the address they have published for support?
Jason Gleim 23-Oct-18 10:32am View    
In your connection string you use AttachDbFilename. That parameter is used to spin up SQLExpress on your machine and attach a database file to it. But you say that you are connection to a local SQL server. I suspect that the issue is you are seeing one thing when the app is running then another DB when the app is not running (because SQL Express will disconnect the file).

The attachDBFile is only for development work. If you need the data to persist you should be specifying the database name in the connection string.
Jason Gleim 23-Oct-18 8:12am View    
Silly question... have you opened a browser on the server and tried opening the URL in it to confirm you can actually reach the site from the server? The exception is happening inside a task which doesn't do a very good job of surfacing what the real problem is. You might try returning the inner exception and see what you get.

EDIT: I totally missed the missing await! What he said too ^^^^ :-)
Jason Gleim 23-Oct-18 8:04am View    
I suggest you download and install "Packet Sender" from It can act as both a sender and listener with flexible setup for UDP and TCP on any port you wish to assign. Use it to see exactly what your reader is sending you then you can use my code from there.

Good luck!