Tuesday, January 30, 2007

We have a house full of sick kids. All have pretty bad chest colds. It really hasn't been that pleasant around here, though I'm hoping that I may escape from getting it.

  • I just heard that author Sidney Sheldon died today at age 89. I can't say that I was a huge fan, in fact I don't think I've ever read anything of his, though I know some who just love his work. I can however respect anyone who has the muse within. I have been trying to get myself to sit down and write. While I work in a technical field, I have no desire to write technical books (in fact I read very few technical books these days). I have too many stories inside that I need to get out someday. A friend of mine, who is an aspiring author, once told me that the only way to become a good writer is to just sit down and do it.
  • On that note, however, I read an article today that states called, How to Become a Better Programmer by Not Programming. Interesting premise and to a certain degree I agree with Jeff on that. It is true that there is a vast divide between those that are excellent programmers and those that just get by. I think that I can tell in a very short time whether someone is an excellent programmer or not. Unfortunately those mediocre programmers often see themselves as top-notch and on the flip side the really excellent programmers are normally fairly humble about it.
  • Ahhh yes….. tax season is upon us. I've just finished up preparing the last of my 1099s I need to prepare for some sub-contractors I had work for me this past year. Nothing like waiting until the last moment. I've only received one of the one's I'm expecting as of yet, but should see the rest of them here in the next week or so.
  • I think I'm going to start a series of posts relating some interesting stories (funny, scary, sad …) from a previous employer. The names will be changed to protect the innocent, though if you know me; it won't be hard to figure out who I'm talking about. No offense meant to anyone, but hey, they are my life stories and I'm going to tell! I learned a lot from working there some good, some not so good. So anyway, be prepared for some.
  • Just for a taste of what I'm talking about, here is a list of some SQL don'ts. This list that Brian put together mirrors some things that my former employer did, despite advice against.
Tuesday, January 30, 2007 10:54:50 PM (Eastern Standard Time, UTC-05:00) | Comments [1] | .NET | Midnight Snack#
Monday, January 29, 2007

Well here was an interesting one. I was working on adding some AJAX capabilities to a few pages. I had added my ScriptManager to my MasterPage and then on each of my pages I needed to, I added the UpdatePanel to that page. Well on one page, while it compiled fine and worked like it should, Visual Studio was showing my an error on the UpdatePanel control as well as each of the controls in the ContentTemplate. The error was;

    Not a known element

And intellisense refused to work. After a bit of research and trial and error, it appears that it may be a bug with ASP.NET AJAX. There does seem to be a simple workaround however. Simply open your masterpage in the IDE and the sub-page will then behave as expected. According to the ASP.NET forums another workaround is to change the asp prefix to something else (atlas perhaps).

Monday, January 29, 2007 10:45:53 PM (Eastern Standard Time, UTC-05:00) | Comments [1] | ASP.NET#

Well here's one that has me stumped. Basically what I have is a ClickOnce deployed app that is deployed to my client's network. I would like to pass it some command line parameters, but for the life of me cannot get it to work. All the examples I can find are for web-deployed click once apps, but the code given there does not work. For web-deployed apps it's very easy to retrieve the parameters using,


and parsing out the parameters (normal query string parameters like www.blah.com/myapp.application?param1&param2). However when using the same construct with the network-deployed app, this simply returns the name of the application file (file://myserver/apps/myapp.application?param1&param2 simply returns apps/myapp.application). Trying to pass parameters in any other way results in windows not finding the application file.

Either I'm overlooking something very obvious or there is just no easy way to do this. Luckily this isn't a must have feature for this particular client, just something that would be nice.

Any thoughts or ideas?

Monday, January 29, 2007 9:55:11 AM (Eastern Standard Time, UTC-05:00) | Comments [0] | .NET#
Saturday, January 27, 2007

I have some work to make up this weekend so my Saturday will be pretty busy. I'm making a "fourth quarter" push to finish up a huge project hopefully by mid-month February. But I'll take a break in the work to see what has been going on.

  • Joel announces version 2.0 of their Copilot remote control tool. While I haven't had the opportunity to use it yet as most of our clients I have a direct VPN in, I have used their trial and it is pretty slick. I keep it in my toolbox for that odd ball time when nothing else will do. Some nice new features including direct connect if possible resulting in possibly faster connections, file transfer, and support for the Mac for those so inclined. Also the lowering of the 24 day pass to $5 makes it so much more inviting.
  • Forgotten SQL Functions – Jason brings up a good point, how often do we go about creating the greatest function to perform some operation only to discover that it's already available built-in? Whether it's SQL or .NET, C# or VB.net doesn't really matter as I'm always discovering something new. I have to agree with a few of the commenter's in the original post. COALESCE is the bomb. See here for a performance comparison between Coalesce and IsNull. Also here is a novel usage of the Coalesce function to build a comma-delimited string.
Saturday, January 27, 2007 12:31:55 AM (Eastern Standard Time, UTC-05:00) | Comments [0] | Midnight Snack#
Thursday, January 25, 2007

This one had me stumped. A large web app I'm working on for a client has some cases where some AJAX would be very handy. I wanted to take this opportunity to learn about ASP.NETs AJAX release as it looked real easy to work with. I watched the videos and followed the instructions and created a test app and all worked well. I then tried to take what I had learned and incorporate it into my existing app. The Partial Rendering did now work and the SupportsPartialRendering continually came back as false. I had checked to make sure that all references were in place and the web.config file was updated with the required <httpHandlers>. Well interestingly enough, I missed a very important part of the web.config.


<xhtmlConformance mode="Legacy" />


With the xhtmlConformance mode set to Legacy, AJAX will not work on your pages. Scott Guthrie has a good explanation with all the gory details. In a nutshell, apps that were upgraded from 2003 to 2005 (which mine was) will have this setting in place. Removing that and automagically, my newly AJAXed pages now work as designed!!

Thursday, January 25, 2007 10:17:27 PM (Eastern Standard Time, UTC-05:00) | Comments [0] | .NET#
Wednesday, January 24, 2007

Snowing pretty good right now, always wonder what you'll wake up to.  If you don't live downwind from one of the Great Lakes, and have yet to experience the joys of lake effect snow.  What a joy.  You can wake up to 20 inches and half a mile down the road, nothing but a trace.  Hard to predict what you'll end up with.  I'm on the southern reaches of the snow belt in Ohio, so I can be thankful for that.

  • I've looked briefly at the Validation Block of the Enterprise Library and it's attribute validation.  And now I've found EViL which also does attribute validation.  Seems like these will be pretty handy tools.  Still trying to mentally wrap my mind around setting up my validation with attributes (just seems a bit odd for some reason), but I think I may just being old fashioned. 
  • Installed Office 2007 this evening and have really only messed with Outlook.  I'm liking it though...love the To-Do Bar, love the way you can collapse both the To-Do Bar and Navigation Pane.  Love the Ribbon and while it can be a bit confusing at first, it really is much more intuitive.  Be back with more updates as I dig deeper into Outlook as well as the other office apps.


Wednesday, January 24, 2007 11:17:20 PM (Eastern Standard Time, UTC-05:00) | Comments [1] | Midnight Snack#
Tuesday, January 23, 2007

Went to the Launch 2007 Tour event in Cleveland today.  I was in the developer track and while it was interesting to see some of the new things you can do, it was really nothing new if you've been paying attention at all.  It seemed like a sales pitch when really most everyone there was already sold.  But hey, can't beat the free license of Office 2007!.

  • Speaking of Vista, here are "5 Sins of Vista" to watch for.
  • I have yet to go through this yet, but this workshop on .NET Instrumentation looks real interesting.
  • If you haven't heard by now.... ASP.NET AJAX 1.0 is released.
  • I've known this was available in 2.0, but have yet to really have a reason to explore deeper, but reading this about creating network aware apps sparked a few ideas for an app I've been working with lately that runs on a slightly unreliable network.
Tuesday, January 23, 2007 10:51:09 PM (Eastern Standard Time, UTC-05:00) | Comments [0] | Midnight Snack#
Monday, January 22, 2007
  • Maintainable Code - Another great post by Jeremy Miller.  I love to optimize code, I find it quite enjoyable to take a bit of code and tweak the last few cycles out of it.  I know, however in the process, I've made my code hard to maintain for a not so beneficial gain.  I'm striving to focus more and more on making my code more maintainable and Jeremy adds another fine post to move me closer to that goal.
  • Performance Iterating Generic Lists - well in seemingly contrast to the above link, here is a post on an optimization.  I absolutely love generics and have found the use of anonymous methods beneficial in making my code more maintainable (at least to me), so I'm happy to see that my prefered technique for iterating through those generic lists in some cases (#3 List.ForEach method with a delegate) is at least not the slowest.
  • I was working today on making some changes to a website for a client today.  These changes involved some enhancements to the login and password maintenance routines.  This stuff was hacked together years ago in 1.0 (upgraded to 2.0, but the code has changed little) and while it has worked fine for many years, it is not the prettiest code.  I tried to incorporate the membership providers into this site with no luck.  Was receiving an OutOfMemory Exception while it was parsing the provider section of the web.config. No solution could be found so after a few hours of trying to solve it, I needed to move on.  I will have to create a test site from scratch and see if I can get a handle on the provider stuff before trying to hook it back into the existing site.
  • Error handling in PowerShell - Nice little post about topic that is not documented very well. 
  • Well it's coming time for a new computer.  While my main machine (my laptop) is working just fine and still has a few good years left in her, my desktop, which is more of my non-work / gaming / wife's machine is in need of an upgrade.  I'll hand my current desktop over to my kids and get a nice new shiny one for myself (and of course my wife!)  I don't think I'll go the route of my buddy Dave, but I'll be interested in hearing how he likes it once it comes.
Monday, January 22, 2007 10:54:54 PM (Eastern Standard Time, UTC-05:00) | Comments [0] | Midnight Snack#
Saturday, January 20, 2007

Not sure if I'm coming down with something or not, but just haven't been able to shake a chill I've had since I got home this afternoon. 

I'm tired...off to bed.

Saturday, January 20, 2007 12:05:16 AM (Eastern Standard Time, UTC-05:00) | Comments [0] | Midnight Snack#
Friday, January 19, 2007

Well in concordance with this, I've decided to post about my favorite tool.  Well in coming up with my favorite tool, I had to search through many of them that I use and love.  But most recently, I believe my favorite tool, that I use every single day has to be ReSharper from JetBrains.  This add in to Visual Studio (I use Resharper 2.5 for VS2005) adds so many tiny benefits it would be hard to list them all.  Just go their site and look through the feature list.  It's simple, fast (as of the new version, the past versions did have some speed issues) and it stays out of the way.  I've gotten to the point now where I don't even realize it is there.  I was at a coworker's machine, which does not have Resharper installed, and I was amazed that I was able to get anything done without it.

Hard to say what my favorite feature is, I really like the Usages (Alt-F7).  The Ctrl-Click Go to Definition is a huge time saver.  Surround With (Ctrl-Alt-J) is another tool I use alot.  I could go on and on.  The hardest part for me has been learning some new keystrokes, for some of the lesser used items, the keystrokes still escape me from time to time, but I'm getting better. 

I won't get into a ReSharper vs Refactor Pro holy war, as both products have a ton of nice features.  I wish I could take the best of both, combine then into one and you would have one killer app.

Oh BTW, JetBrains has just put out an update as I've mentioned previously

Friday, January 19, 2007 10:43:15 AM (Eastern Standard Time, UTC-05:00) | Comments [0] | .NET | Cool Tools#
Thursday, January 18, 2007

Went to my son's 6th grade band concert.  Love watching my kids do about anything, whether it's sports (he's quite the athlete, didn't come from me) or his music, I just love these things! 

  • 7Zip In Memory Compression C# Code - I've been wanting to switch to 7Zip for awhile.  I purchased WinZip a few years back and it has worked well, but 7Zip has intrigued me.  Now with this SDK, perhaps I should take a closer look.
  • TryParse() - Here's another one I like to use alot.  I'm always on the lookout for code that simplifies my code.  Very nice addition to 2.0
  • Start and Stop Services - This is here more for my own info.  I have used this a few times in the past and always spend a few minutes looking this up...now I'll know exactly where it is.
  • As a small MicroISV myself, good the hear Scott talk about it on his latest Hanselminutes.  Another nice place, though it hasn't been updated in a while, is MicroISV.com.
  • Blog about your favorite developer tool tomorrow.  I've got so many, I'll have to think which one I would like to highlight.
  • The front-runner for my favorite tool blog post, Resharper, has just released an update.  Nice to see a quick update to fix some stuff.  Looking forward to the next major update.
  • <begin soapbox>Watch the price of gas creap back up if this gets signed into law.  Don't forget that most any tax placed on business, get's passed right back to the consumer....so who ends up paying these extra taxes?  Yep, you and I, the ones the Dems say they are trying to help.</begin soapbox>


Thursday, January 18, 2007 11:37:05 PM (Eastern Standard Time, UTC-05:00) | Comments [0] | Midnight Snack#
Wednesday, January 17, 2007

I guess I've been under a rock, because I just discovered this operator this evening.  Catching up on some of my unread blogs and read this post on Tests for Null in which mentioned the new coalescing operator (??) in C# 2.0.  How had I never noticed this before.  I could use this almost every day and I'm always one for neatness and compact code so this kind of operator will fit nicely into my toolset.

How does it work?  Well it simply checks if something is null, if not null, returns that something otherwise if null it returns the alternative.  Works very similar to the Coalesce keyword in SQL Server (which I do use often)

ThisClass objClass = aClass ?? new ThisClass();

Which is equivalent to

ThisClass objClass;
if (aClass != null)
   objClass = aClass;
   objClass = new ThisClass();

and also;

ThisClass objClass = (aClass != null) ? aClass : new ThisClass();


Wednesday, January 17, 2007 10:32:22 PM (Eastern Standard Time, UTC-05:00) | Comments [0] | .NET#
Tuesday, January 16, 2007

Let's get right to it:

  • I've seen this around before (I think I may have even installed it once to try it out), but one of my goals this year is to focus a bit more on writing.  Darkroom may just help me out with that.  I'm easily distracted and that is probably my main reason for not writing more.
  • Managing Processes in Powershell.  I'm just now getting into powershell so I'm reading up just about everything I can find.  Good examples on the flexibility and power of PowerShell.
  • Using Anonymous Methods - I for one love anonymous methods.  I use them quite a bit and have been meaning to write up something a bit more elaborate...here is a quick and simple post on a good usage of anonymous methods.
  • One Stop Shipping Tracking  - Nice service here to track all your shipments from different carriers.  Also some nice tools to estimate shipping charges.  Might be handy if you do a lot of shipping or buying / selling on eBay.
Tuesday, January 16, 2007 7:39:19 PM (Eastern Standard Time, UTC-05:00) | Comments [0] | Midnight Snack#
Monday, January 15, 2007

Well here it is late at night waiting to see if I'll be driving in snow in the morning...I hate the idea of waking up to the roads covered in snow in the morning.  Been a very mild winter so far here in northeast Ohio...I've gotten spoiled.

  • Yes I watch 24 almost religiously.  I really don't watch much TV, but that is one show I do enjoy.
  • Ever wanted to manage multiple assembly's version info from one place.  Well there ya go.  Seems pretty obvious now that I've read it.

I'll keep it short tonight...

Monday, January 15, 2007 11:38:36 PM (Eastern Standard Time, UTC-05:00) | Comments [0] | Midnight Snack#
Friday, January 12, 2007

Wow, I managed to do this two nights in a row!!

  • It's really amazing how easy .NET makes some things.  I whipped up a quick app today that handles some data uploads to a web app I'm developing.  I created it to allow for plugin modules for different data uploads.  Really some basic stuff and from start to finish, about 2 hours of work.  I can remember trying to do something similar in VB6 many, many moons ago...not quite so easy.
  • Tomorrow is my daughter's 9th birthday...tonight is her sleep over with some friends at our house....use your imagination what a house full of 8 and 9 year old girls looks and sounds like!
  • Good article on Coding Horror today on the importance of setting good defaults.
  • CodeRush and Refactor! Pro 2.1 are released.  I'm a Resharper man myself, but Refactor Pro has always looked very good and many have spoken highly of it.  I'll be honest, Resharper got me on their holiday $99 dollar special which I believe runs through the end of this month and it does have some great tools (love the usages F7 tool). 


Friday, January 12, 2007 10:44:20 PM (Eastern Standard Time, UTC-05:00) | Comments [0] | Midnight Snack#
Thursday, January 11, 2007

Who doesn't enjoy a quick snack before bed.  Well here is my attempt at what everyone else seems to be trying.  A few quick snippets of information, links, thoughts, ... whatever, more or less as often as I can.

  • I may be a bit behind, but I've finally starting working with Enterprise Library from Microsoft.  Specifically the Data Access Block.  I'm really diggin it.  I'm just now scratching the surface, but it didn't take very long to take a fairly large ASP.NET project I'm working on and converting all my data access to use it.  I'll probably blog about it more eventually. 
  • Speaking of the Enterprise Library and application blocks in general, I need to check out some of the other blocks and see what I can use and where.  I'm really intrigued by the Smart Clients blocks
  • I've also started playing with PowerShell.  Again, perhaps I'm late to the party, but I guess better late than never.  Scott Hanselman has been talking about for quite a while and is quite the proponent, so I figured I needed to take a look for myself.  So far so good...learning curve seems big, but lots of potential.
  • Been using the Emergent Task Planner from David Seah for the last week...and I must say, putting things down on paper is very conforting to me.  I always did prefer to write things down, but as an IT consultant, I always feel like I should be using something electronic, seems a little "dirty" to me to be using paper...but I like it!


Thursday, January 11, 2007 11:33:37 PM (Eastern Standard Time, UTC-05:00) | Comments [0] | Midnight Snack#
Monday, January 08, 2007

Again, another post with something that seems obvious at the moment and something I've done many times and it works like a charm everytime.  Last week I ran into a situation where I was performing a SqlBulkCopy on some data up to a Sql Server on a shared host.  This process has run nightly for over a year, however Friday the structure changed slightly so my client called me in to make the changes.  Changes are made and the process runs fine. 

Moving forward about 6 hours....suddenly an exception is generated in the SqlBulkCopy (don't recall the exact wording on the exception) which seems to indicate that either my structures between source (Access) and destination are out of sync or perhaps there is some corrupt data.  Since it worked fine previously in the day, I opted towards looking at the latter.

Quick once-over on the source data didn't show any problems and after doing some more preliminary searching....data appeared to be fine, but there were tons of records and I'm sure I missed something.  So what was my secret tool in solving this problem...

   Select Top 10 from myData

Just simply ran the the above select when selecting my source data, changing the Top XX to different values to zero in on the record that was causing the error.  Once I narrowed it down to that one record, it was a simple matter to scan the data looking for a problem.  Within seconds, I found the problem (calculated field which had a division by zero error), fixed the field and all was well.

Monday, January 08, 2007 5:59:57 AM (Eastern Standard Time, UTC-05:00) | Comments [0] | SQL Server#
Thursday, January 04, 2007

This is something that I tend to forget even though it's pretty basic and probably obvious to most.  I have a comma delimited string which I wanted to put into a List<>.  Here's a one-liner to get the job done.

   List<string> aList = new List<string>();

Where myString is my comma-delimited string.  Pretty basic, but very handy.

Thursday, January 04, 2007 10:06:53 AM (Eastern Standard Time, UTC-05:00) | Comments [0] | .NET#
Monday, January 01, 2007

Well here we are at the end of another year.  Boy did it go fast.  This has been another good year both professionally and personally.  Personally, our family is healthy and happy.  We've grown together as a family and done a ton of fun things together this year.  Professionally business has been good.  While, looking purely monetarily, 2006 has been about equal to 2005s production, things seem to be picking up none-the-less so I'm looking forward to a good 2007. 

So where is the new year leading us? Not sure yet.  Where am I trying to drag it (perhaps kicking and screaming)...well I want to make this year the year that we break out of the mold and take the business to the next level.  To me that means, going after new clients while still maintaining good relationships and high levels of service to our current clients.  This will be a big challenge for me.  I'm not a real outgoing person and the thought of putting myself out on a limb and trying to attract new clients is kind of scary.  Most of my business so far as been word of mouth and that's easy when you come recommended to someone.  But to sell our services to someone I've not met and has no reason to believe that we can help them, well that's a different story.

Another step in growing the business is to look at creating a product that we can sell and service in niche markets.  Yes we have ideas on what those products are and which niches to attack, but no...I'm not sharing :->  This could be a huge step (and a lot of work) but would be a good step for us.

In closing, if 2007 is even close to as good as 2006, then I'll be happy, but I'm not content to stop there.  So we shall see what 2007 brings and we'll trust in the good Lord that He will provide all we need and will open and shut the doors as they come before us. 

God Bless you all and here's looking forward to a good and prosperous 2007.

Monday, January 01, 2007 10:30:47 AM (Eastern Standard Time, UTC-05:00) | Comments [0] | Misc#
Admin Login
Sign In
Pick a theme: