I am giving a presentation titled "Exception Management Strategies" at Luzerne County Community College for the .NET User Group's monthly meeting.  If you haven't done so yet, please register and I'll see you there.


 
Categories: .NET | C# | Community | Software Development | VB.NET

That's this Saturday folks!

Where: Harrisburg University (downtown Harrisburg, Pa)

When: 8:00am-4:00pm

What's the scoop:  There are several sessions you can attend, and you are should to register for the event.

I have two talks: Exception Management and Using the ObjectDataSource/Data Source Controls in Web Applications.  I'll be posting the slides and samples after the code camp.


 
Categories: .NET | ADO.NET | Community | Software Development

November 26, 2007
@ 07:00 PM

I’m often asked to assist with some basic exception handling strategies for code. Below are a few exception handling pointers and hopefully expand on them in later posts.

· After identifying suspect code, determine if it will benefit from exception handling, the tester-doer pattern or the try.parse pattern. There are some times you won’t want to use a try/catch, (e.g. check to see if a connection is closed first before closing it rather than wrapping the close call in a try catch).

· Where possible, catch specific exceptions, not just System.Exception. (i.e. If you know the exception to be caught will be a SqlException, catch that)

· Don’t use return error/success codes and rely on other developers (or yourself) to use or check the value of return codes. More often than not, return values/codes from a function are just wasted.

· Exceptions aren’t always errors. Exceptions can represent errors but they can represent anything that isn’t ordinarily going to happen during the execution of your code, and that isn't always an error.  

· Use the finally block. You’ll be able to save half the coding and coding around other code you’d normally need to do without it. If you don’t use a finally block, not only will you have to check for specific states of variables yourself to cleanup code when an exception has occurred, but you will have to check these flags/variables again when things run smooth.  Finally trims code and makes things smoother.

· Make sure the state of the application hasn’t changed after the exception. There is one of two states that you want to leave an application method after an exception, 1) the state the app was in before the method call or 2) as if the method had never run before.  Either way, if an exception occurs, you have some work to do to make sure the app state is solid.

· Users should never have to see or deal with an exception that has been bubbled all the way up the stack. Not only does break the state rule but the user has just lost confidence in this application.   The only worse thing you can do to the user now is to have the app hang all day.

· Log all exceptions. By logging all exceptions, you can generate information, metrics and reports about the internal state of the program to perform diagnostics and create a better quality version next release.


 
Categories: .NET | C# | Software Development | VB.NET

November 20, 2007
@ 04:46 PM

I've recently been asked to join the ASPInsiders.  This is a great group to be a part of, since now I will be working very closely with some of our industry's best on some very exciting projects, as well as interacting with the MS teams directly!


 
Categories: Announcements | ASP.NET

November 19, 2007
@ 09:23 PM

Get it at the MS download center.  There's also an express version too!


 
Categories: Announcements | SQL

Perhaps I should know about this already, but I was not-so-blissfully unaware that you can disable that annoying, nagging popup window that keeps asking you to reboot after new updates are installed.  That dialog drives me absolutely insane, as I'm positive it waits for me to be doing some important coding and then it decides to disturb me and throw me off track.  Hop on over to Michael Pietroforte's blog for instructions on how to disable the reboot option.


 
Categories: IT Pro | Tips | Windows

November 19, 2007
@ 11:38 AM

Available on the MSDN Subscriber downloads.  Get it hot off the press!  Of course, you may be best off waiting a bit for the load to calm down, as the servers are very busy serving up VS downloads to the masses of developers currently downloading.


 
Categories: .NET | Announcements | ASP.NET | Visual Studio

If you would like a dropdown that displays one static item such as  “–Choose One—“ while the rest of the items are data bound, then check out the code below:

<asp:DropDownList ID="drpProucts" runat="server"

    DataSourceID="ProductsDS" DataTextField="ProductName" DataValueField="ProductId"

    Width="150px" AppendDataBoundItems="true">

    <asp:ListItem Text="--Choose One--" Value=""></asp:ListItem>

</asp:DropDownList>

Set the AppendDataBoundItems property of the dropdown list to True, and add in the static list item.  Your dropdown will look something like this:



And there we go!  A dropdown list that also has a static entry stating to the user that s/he should choose an entry from the dropdownlist.

 
Categories: .NET | ASP.NET

November 12, 2007
@ 04:08 PM
Trying to keep up to date?  Download the .NET 3.5 Commonly referenced namespaces poster. There's two sizes, a nice .pdf file and a two file split download in case you want to re-wallpaper your cubicle.


 
Categories: .NET

November 13th: Central Penn.NET User Group Meeting
Scott Allen’s topic is titled “Going Asynchronous with ASP.NET AJAX”.    Judy Calla will be speaking about SQL Reporting Services.

November 19th: Lehigh Valley .NET UG Meeting
The topic and speaker are TBD.

November 27th:  .NET Valley Live Event
Our local guys Jason Gaylord and Mike Murphy will be speaking on developer and IT topics that are still TBD.

November 20th: Philly .NET Group Meeting
This month’s meeting is the “15 minutes of fame” where 10 presenters will be presenting for 15 minutes on their favorite topics.

Special Event - December 1st: Harrisburg, Pa Area Code Camp! 
A code camp in the state capitol!

Along with other presenters, I will be speaking on Exception Management Strategies & Best Practices.  Check out the Central-Penn.NET user group website for more information.


 
Categories: .NET | Community