Monday, February 09, 2004 - Posts
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!
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!
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
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!