Monday, April 19, 2010

Threading the UI in WinForms/WPF

I figured out how to put the UI on a separate thread than the functionality.





This is what you do in the MyForm.cs class. Begin invoke on the Dispatcher.

You must create a DELEGATE -> ClickDelegate and cast the new delegate as that.

Thread Static

A variable or class can be static, but only static to a thread using:

Thursday, April 15, 2010

One-click download for text file on HTML

To create a one-click download link on a webpage, for a text file that is basically a 'csv' or comma separated values file, put the '*.csv' extension.


.Net MySQL Connector Error

Apparently there is an error that can occur when a MySQL command tries to execute, but the execution takes longer than the default 'CommandTimeout' of 30 seconds.

To fix the problem, change to MySQLCommand.CommandTimeout to something more useful.

MySQL_Upgrade MySQL_Check fix for "column count of mysql.proc is wrong"

from command prompt: (remember to have NO space between '-p' and '[password]')

C:>mysql_check -u [user] -p[password] --repair --all-databases

This will repair your databases. This does not work on InnoDB.

C:>mysql_upgrade -u [user] -p[password] --all-databases

This will upgrade your databases.

This fixes the 'column count of mysql.proc is wrong' error when using MySQL Workbench on a databases that has been created with MySQL Server earlier than 5.2

Monday, April 5, 2010

Netstat

For networking information there are some handy 'Command Prompt' commands.

%> netstat

-a : listening and established ports
-an : all (I think)
-o: all owning processes with each connection