CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

Grant Killian's Blog

No, this has nothing to do with beer -- but maybe it should?

February 2004 - Posts

  • Some .Net Book Reviews (finally)

    I finally got around to posting a bunch of book reviews for WeProgram.Net; I put them on the back burner for weeks, but finally got to them as I declared tonight my “catch up and stop billing” night.  If you haven't checked out the book review section at WeProgram.Net, you should; there are 13 .Net and .Net-related titles reviewed by real programmers who don't want you to waste time on a bad book.  There's nothing worse than dropping $50 for a disappointing tech book!  The book review section can help separate the good from the bad. 

    Darrell Norton contributed a few reviews, and I think one is from Chris Hale (I don't think Chris blogs [yet]).  My two latest contributions are Web Services Enhancements and Extreme Programming Pocket Guide.

    To those of you who sent reviews, I appreciate your patience!  I've got a few more of my books I could add, but I have to think of what I want to say about them, first . . .

    Happy .Netting!

     

  • Dinner.Net in Hampton Roads

    Jim Meeker has suggested a Hampton Roads Geek Dinner on Thursday; I plan to make it (assuming we get enough committments, Jim!). 

    Let Jim or me know if you're interested -- I imagine we would meet at the Hilltop Brewery anytime after 5 PM.

    I know dozens of developer types in the area, some very close to HillTop, so this could be something fun to do another time with more planning.  I'm hoping we pull it off this Thursday, though! 

    If nothing else, I can buy Jim “I always win book giveaways“ Meeker a beer.

    Happy .Netting! 

  • Conference Cruising

    MySQL cruise, anyone?  I came across this courtesy of Jeremy Zawodny at http://jeremy.zawodny.com/blog/archives/001194.html.  My friend Scott Lerberg will surely get a kick out of it!

    I'd be more interested in the .Net Nirvana cruise instead.  I'm sure MySQL has plenty of stuff to fill a week of sessions about, but MySQL is just a low end data repository for my purposes (maybe it would be more high-end to me if I had 5 days on a cruise ship devoted to it).

    The .Net Cruise offers a few of those Wintellectuals, Rob Howard, and more. 

    I think I'll get more bang for my buck, however, at the DC Devscovery conference in April.  WeProgram.Net has a great deal organized where our user group gets a good discount and some other Wintellect perks.  Very nice of Wintellect!  It should be a great time in April!

    Happy .Netting

  • DataReader to DataTable Happy Ending

    I'm doing some .Net and MySQL work and I've got a data access layer that does all the heavy SQL lifting.  One of the needs that came up was to convert a DataReader (IDataReader, really) to a DataTable.  In good XP style, I wrote “the quickest implementation that solves the business need” for creating a DataTable from an IDataReader.  This involved looping through the fields and was a bit cumbersome -- but it worked.  Again, in good XP style [Darrell Norton, correct me if I'm wrong], I went back and refactored the code after passing all my unit tests.  This time it included digging through documentation and weblogs on the DataReader-to-DataTable issue because I didn't like all the looping and verbosity of the code.  Rather quickly, this post by Roy Osherove turned up.

    Roy was tackling the same issue and, in the comments to Roy's post, Josh (last name and additional info was not posted) pointed out the base DBDataAdapter class includes an overload of the Fill() method that includes a DataTable and a DataReader.  The OdbcDataAdapter (and all the provider specific adapters I checked out -- not even for SQL Server) don't include this overload -- but if you create your own class deriving from DBDataAdapter directly, you're all set!  No more loops and explicit DataColumns to create -- the .Net Framework has a solution baked in; the trick was finding the base DBDataAdapter to begin with.

    My custom class required implementations to the 4 abstract methods in DBDataAdapter (CreateRowUpdatedEvent, CreateRowUpdatingEvent, OnRowUpdating,OnRowUpdated) -- but that only took a few minutes.  Add another minute or two to run the unit tests with happy green results, and I was all set.  I'd developed a much leaner solution.

    Without the blog-o-sphere this would've been a tougher task; I would've been stuck weeding through the documentation to find a solution (or checking out books or online articles for the tidbit I needed).  Granted, maybe it would've occurred to more of you to check for base DataAdapter classes to see if they expose a richer set of Fill() method overloads, but that thought didn't occur to me.  To be certain, for future data access challenges, I'll be sure to keep the base data access classes in mind. 

    Happy .Netting!

  • Metabase is NOT such a Meta Headache

    I may be late to the party (and not for the first time!), but I just came across the Edit-While-Running feature for the IIS 6 Metabase -- no reboots or service stops-and-starts required.  I'm not in our Network Admin team, but even they weren't aware so I thought I'd share this way to modify the IIS Metabase while IIS is running.

    From TechNet:

    1. In IIS Manager, right-click the local computer, and then click Properties.
    2. Select the Enable Direct Metabase Edit check box. Enabling Direct Metabase Edit changes the EnableEditWhileRunning property from 0 (FALSE) to 1 (TRUE).

    The Metabase.xml file controls IIS settings; for example, there is a setting for the maximum size of a file that can be posted to the site -- I speak to another way to fix it here, but the Metabase works for all IIS instead of just an individual application (so beware when you adjust the Metabase because you are impacting every app hosted on that server!).

    Also, when editing the Metabase, stick with Notepad; I used WordPad and learned the hard way that WordPad introduces some non Metabase.xml friendly characters into the file.  Thankfully, IIS 6 rolls back to the previous “good” Metabase.xml file.

    Happy .Netting!

More Posts