Sunday, January 30, 2011

To Read about wpf

http://msdn.microsoft.com/en-us/library/ms742806.aspx
http://msdn.microsoft.com/en-us/library/ms747183.aspx
http://msdn.microsoft.com/en-us/library/system.windows.routedeventargs.aspx
http://msdn.microsoft.com/en-us/library/ms742550.aspx
http://msdn.microsoft.com/en-us/library/ms752059.aspx
http://msdn.microsoft.com/en-us/library/system.windows.eventsetter.aspx
http://msdn.microsoft.com/en-us/library/system.windows.eventtrigger.aspx

Saturday, January 29, 2011

Marking Routed Events as Handled, and Class Handling

Marking Routed Events as Handled, and Class Handling: "Also, input routed events that have a tunneling and bubbling pair have a distinct handling logic. If the tunneling/preview routed event is marked as handled by an event listener, then the bubbling routed event will be marked handled even before any listeners of the bubbling routed event receive it. The tunneling and bubbling routed events are technically separate events, but they deliberately share the same instance of event data to enable this behavior."

Thursday, January 13, 2011

Use the "using" C# key word to build sql connection

While reviewing some C# code written by a newbie programmer and buddy of mine, I noticed a lack of calling Dispose() on SqlConnection and SqlCommand objects. And in all cases, the database code was not placed in try / finally blocks. This is typical newbie style of development that everyone, including myself, attempted in the very beginning.

SqlConnection cn = new SqlConnection(connectionString);
SqlCommand cm = new SqlCommand(commandString, cn);