.NET Data PracticesSearch this Blog!
Beta 2 is now available for our U.S. customers and includes a new Media Sharing feature, as well as improvements to the Beta 1 release that are based on your feedback. Learn more about Beta 2 updates ......
Here’s a really good cross-browser implementation of a scrolling data grid for ASP.NET 2.0. Advantages over similar controls Cross-browser compatible: Mozilla Firefox 1+, Internet Explorer 5+, Netscape 7+. <select> elements do not float above the header. This is a common complaint with other solutions. Last scroll position is submitted on postback, which you can then use to set the start scroll position. You still use the ASP.NET DataGrid control, so you don't lose Intellisense in Visual ......
A good tutorial on how to roll your own tab strip for an application built on ASP.NET 2.0. From the intro: In this article I explain how to create a tabstrip control within ASP.NET 2.0 using existing controls. We all had hoped with the release of .NET 2.0, Microsoft would incorporate many more needed and everyday Webform controls, such as a TreeView, Menus, TabStrip, LoginXXX, etc, and they did for the most part. They provided us with more controls then we know what to do with, however, there is ......
Here’s the article on MSDN. Excuse me just for a moment. I want! I want! I want! (takes a deep breath) Ok, I’m better now. If these next few lines don’t get you excited, you’ve never been a DBA. Managing Database Objects and Schemas as Version Controlled Items Unit Testing Stored Procedures Rename Refactoring of Database Objects ......
(with apologies and thanks to Robert DeNiro—unfortunately I don’t have a baseball bat handy)
Jeff Atwood’s take on how technical documentation really gets written.
The Enterprise Library team is soliciting feedback on feature prioritization for the next version of the Enterprise Library. Now’s your chance to tell them you really need that blue button on the customization tool.
Read all about it at Tom Hollander’s blog.
Do you like the 1–5 star rating system that you can use on Amazon.com to “improve your recommendations”?

Since I’m on an AJAX kick this morning, here’s an AJAX implementation.
The IE team has a blog. Actually, they’ve had a blog since July 21 2004. Shows how much I pay attention. But there’s a post on IE7’s CSS position that’s well worth the read. From the intro: We understand that we are far from being done and we know we have still a lot of work ahead of us. IE 7 is a stepping stone in our effort to improve our standards compliance (especially around CSS). As an example, in the platform we did not focus on any proprietary properties – though ......
By now you’ve heard of AJAX, but more importantly, your customers have. So, you’ll often get the question of “can’t we just do this in AJAX?” Most often, the answer is “yes, but…” AJAX isn’t a magic wand. It’s just a framework for doing a lot of the things you’ve been doing informally for ages. Here’s a good introduction on the Microsoft implementation, Atlas, with a little bit of compare and contrast with some of Atlas’ ......
Here’s a very good article on how to globalize and localize your ASP.NET 2.0 application. If you’re designing a public website, you probably need to look at this. Globalization is defined as the process of developing a program or an application so that it is usable across multiple cultures and regions, irrespective of the language and regional differences. For e.g. you have made a small inventory management program and you live in a region where English is the main language, assume England. ......
Did you know that there’s a reporting engine available to you in VS 2005? I’m not talking about Crystal, or MS SQL Reporting Services. I’m talking about the Local Reports Engine. Check out a sample here.

I’m sure I could find a use for this, like…err…no, I take that back.

A: Writing Better Software. Duh. So, why don’t we write better use cases then? Or at least learn how to read them better? (One might also think that learning to read them better might enable one to write better ones in the future also). Anyway, Tyner Blain has a few great articles on these subjects: The 8 Goals of Use Cases We write use cases for the same reasons that people use our software - to achieve goals. In our case, we want to assure that we are creating the right software. By looking ......
I’m a little slow. I misread the stuff about this when it first came out and didn’t realize what I was seeing. patterns & practices Guidance Explorer is a tool that enables discovery, composition and consumption of high quality development guidance. The Guidance Library is a catalog of guidelines and checklists that encapsulate development knowledge in several technologies such as .NET and ASP.NET. The Guidance Explorer tool provides a convenient means to view and edit the catalog. ......
I’ve mostly stayed away from blogging about DLinq and other .NET 3.0 goodies, because I think they’re too far out in the future to be worth that much attention. However, I do think that Linq is worth keeping an eye on because I think it’s going to be one of the best parts of (insert .NET language here) 3.0. And to go along with DLinq, there are some massive changes coming to ADO.NET. I’ll follow up on these more when I feel the time is right, but for now, it’s worth ......
I really like this method for parsing XML. It’s clean. It’s simple. It’s easily extensible. And, it’s OOP. From the introduction: There have been times when I've needed to parse an XML file and configure some objects. XmlReader is very flexible, but too low level for the simple task at hand. The built-in serialization is a tempting option also, but not flexible enough and too intrusive. DOM is too memory intensive for large files. So after much frustration and percolation, ......
TDD is a great way to do development, and using Mock Objects is almost a requirement for doing TDD well. Unfortunately, Mock Objects often lead to unnecessary complexity and violation of several TDD principles (YAGNI and Do The Simplest Thing That Could Possibly Work). Eli Lopian has come up with a workaround for this, that enables you to continue to Do The Simplest Thing that Could Possibly work and remember YAGNI and yet use Mock Objects. Check it out ......
Another task that seems to come up frequently for me is adding a command prompt to my application. I haven’t had to do one recently, but when I do, I’ll probably look at this
article on CodeProject.
The p&p group, boldly ignoring this advice on software factories is coming out with several factories these days, the Smart Client Software Factory, the Mobile Client Software Factory, and the Web Service Software Factory. Read more about what they’re doing here ......
This application is an IL Code analysis tool for looking for orphaned code, types, methods, and fields that are not used. From the introduction: Several times throughout my career, I have worked on large software projects that contain dozens of projects in a solution, thousands of classes, and tens of thousands of methods. It is always a chore to keep all this code straight, and eventually after a few years of updates and code changes, some classes and methods become deprecated...unused. But they ......
This is a decent article oin on the Command Pattern on CodeProject by Chris Laster. I’ve linked to his stuff before, and generally find it well-written. This one might be a little bit on the simplistic side. I tend to think of using the Command Pattern more often for things that need to occur asynchronously or in another thread, but obviously that’s not a requirement ......
Do you ever re-install your OS and then spend the next hour (or more) re-installing all of your drivers? I’ve gone through this several times myself. Innovative Solutions has the solution to this and it’s called DriverMax. It lets you back up all (or even just some) of your current drivers and re-install them all at once. And the price is definitely right. $0. From the website: DriverMax is a new program which allows you to easily reinstall all your Windows drivers. No more searching ......
Sometimes you make a reference type that you want to behave more like a value type. Why not make it be a struct? Then it’d be a value type. Possibly the answer to that question is that you should make it a struct. But, there are some conceivable memory issues with this. What you really want is something that looks like a value type, but behaves like a reference type. For example, consider the string object. You can do this: string name = “Chris J. Breisch”; Just like you might do: ......
This seems pretty cool. It seems even more flexible than some commerical products I’ve seen that do similar things.

If you’re doing ASP.NET development, you should probably have a copy of
this on your wall.
A necessary evil of ASP.NET development is the ViewState. And if you’ve done much ASP.NET development, you’ve realized that you often need to turn the ViewState off for things that don’t really need it to reduce your page bloat. But, what do you do when you’ve eliminated everything you think you can, and your page size is still huge? Well, you really have three options: Abandon the ViewState concept completely (not something I recommend) Store the ViewState on the server somehow, ......
Dave Hayden has two good blog entries on this subject: One on Saving and Retrieving Images from SQL Server Using DAAB and ADO.NET 2.0, and the other on Saving and Displaying Photos in SQL Server using ASP.NET. The former details putting the images in your DB and getting ‘em out, while the latter shows you how to display them on your web page once you’ve retrieved them. As always for Dave Hayden, the results are top-notch (well, except for the fact that he uses in-line SQL, but nobody’s ......
This article on CodeProject is one of the best I’ve read in recent memory. It details how to use the MVP pattern in ASP.NET, with a small sample and then builds on it, adding user controls, events, page redirects, security and then shows you how to build this into your Enterprise Architecture. Only complaint? One could argue (incorrectly in this case, I think) that it suffers from too much OOP ......
Jeff Atwood takes a quick look at various JPEG compression levels and how much picture distortion you can expect from them, and from repeated decompressions and recompressions.
If you’ve worked in C#, C++, Java, or even C, you’re familiar with the conditional operator (?:), but I’d never stumbled across the null-coalescing operator (??) until I read this blog entry by Dave Hayden. He gives a perfect example on how to use it: string fileName = tempFileName != null ? tempFileName : "Untitled"; If tempFileName is not null, fileName = tempFileName, else fileName = “Untitled“. This can now be abbreviated as follows using the Null-Coalescing Operator: ......
Subject line says it all. This keeps you from doing silly things like leaving “debug=’true’” in your web apps.
Jason gives a good amount of detail on
how to answer the Microsoft Interview questions. Hmmm…maybe this should’ve been entitled “How NOT to Handle the Microsot Interview”.
This is a neat little
hack in Visual Studio to let you know when your code is too “wide”.
This is a pretty good article on CodeProject about writing a dynamic accessor for properties. The interesting thing is how close he gets to the performance of compiled code (1/2 speed), and how much better he does than reflection (30 x speed). We all have to do this at times, and I wouldn’t have guessed you could improve upon reflection by quite this much. Worth a look. ......
Paul Stovell has written a good
article on how to roll your own ErrorProvider for a WPF project. Also gives some elementary understanding of XAML, and uses the Strategy Pattern as well. And since this is all part of .NET 3.0, we should pay attention, because we’re going to be stumbling down this path ourselves some day.
A good article on CodeProject on using Dynamic Themes in ASP.NET 2.0. ASP.NET 2.0 makes it very easy to give your site a complete makeover in just a few lines of code. ASP.NET 2.0 makes dynamic themes really easy. No need to envy someone having cool multiple themes you can have your own instantly! This instruction shows you step by step how to make dynamic themes in C#. You can practice this code alone with Personal Web Site Starter Kit. Source code can be download at http://www.edream.org/image... ......
Ok, so we all use NDoc and love it. You do use NDoc, don’t you? Well, you may have stopped using it if you’re doing .NET 2.0 development, because NDoc’s support for .NET 2.0 is, well, not very satisfying. Microsoft has recognized an un-fulfilled need here and started work on a project called SandCastle. Sandcastle produces accurate, MSDN style, comprehensive documentation by reflecting over the source assemblies and optionally integrating XML Documentation Comments. Sandcastle has ......
Jeff Atwood at Coding Horror thinks so. How would you render the following XML fragment? <status code="1" /><data> <usergroup id="usr" /></data> He does it in two lines of code without bothering with all of that XmlWriter stuff. The idea of "write once, run anywhere" via a complex set of objects and adapters is a pleasant one, but it also adds a heavy burden of verbosity and complexity to your project. And you probably aren't gonna need it anyway. Sometimes it's simpler and ......
…about ASP.NET 2.0 Data Access, but were afraid to ask. This article on www.asp.net has 15 different tutorials on the subject in both VB.NET and C#. This should be required reading for a beginner and well worth a look for the more advanced. You may download the code, and PDF’s are also available of all the tutorials for offline viewing. ......
This article on CodeProject deals with the intricacies of managing delegates and multiple threads. If you’ve ever tried to use or modify a Control from any thread other than the main thread, then you likely have run into some of the difficulties Leslie Sanford is trying to solve. I need to go back into a little utility of mine and hook this in, because it’s a better solution than the one I came up with. Note that this uses Delegates, SynchronizationContexts and the ISynchronizationInvoke ......
A good (and surprisingly easy) technique for painting the tabs on your tab controls in Windows Forms yourself. Lets face it, tabs are wonderful, but they’re often ugly, even the Infragistics ones (some might say “especially the Infragistics ones”, but that’s a topic for another day). This article shows how to clean them up yourself. A project I have been working on required a tabbed user interface, and for some time, we had been using the excellent tab control from Infragistics. ......
Another great article on Tyner Blain, this time on evolution vs. revolution. You need all types. In America’s past we tended to be better at revolution, not so great at evolution. Where was the television invented? America. Where was it made great? Japan. In Japan they tended to emphasize evolution over revolution. However, those are just tendencies, and nowhere near absolutes. Japan is getting much better at innovation these days, and we seem to be emphasizing evolution more. The quick buck ......
Generics get all the press in .NET 2.0, but anonymous method are pretty cool too. CodeProject has an article on using them that’s exceprted from Practical .NET2 and C#2. I haven’t read this book, but based on the stuff I see here, it looks like it’s very good ......
It’s no secret that I’m a fan of the new Office user interface. But how to get it into your app? I’m too lazy to write my own ribbon. Fortunately, someone else has already done the heavy lifting for me. Check out these controls on GotDotNet ......
Keith Brown has written a great article for MSDN on how to build identity-aware applications for .NET. From the introduction: What is an "identity-aware" application, anyway? In my mind, first and foremost it's an application that relies upon details of its clients' identity, adjusting its behavior based on those details. That's why the first section of this paper focuses on authentication. Another part of being identity-aware is being directory aware. I'm not here to tell you to throw away SQL Server ......
A good article on beginning Atlas development on CodeProject. From the introduction: This week I had been reading a few blog entries, and they seemed to suggest that Atlas was maturing fast and it was time when you could actually do things with it without having to spend hours and hours reading manuals. I decided to take the same “Hands on” approach to see how much things had changed since my last encounter with Atlas. This time, my focus was to download Atlas and take it for a test ride ......
Kent Boogart has written a simple set of helper classes for .NET development that can be used to properly validate arguments and raise events and exceptions back to the user (caller). Regular use of something like this not only makes your code more reliable, but also more maintainable. He aptly demonstrates some common pitfalls and how using these classes can help you avoid them, such as: public static string ChangeCase(string val, Casing casing) { if (casing == Casing.Upper) { return val.ToUpper(); ......
There’s really no point here, other than just a general thought that came up while watching Disney movies last weekend with my two-year-old. What Disney Movie Is This? The story (plot points are mostly in order): · In the beginning, animals nearby come to see the birth of the prince · Early on, the prince goes to an interesting new place, that's very dangerous. A female friend is with him. This female friend is a little more graceful than the prince. When the danger appears, he's ......
Scott Sehlhorst at Tyner Blain asks one of the ultimate questions: How do we find out what someone wants when they don’t know what they want or what they can have? Fortunately for us, he has an answer: We use personas to identify different classes of users in a software system. We use those personas to drive feature prioitization and design decisions. When making design decisions, we focus on the level of competence of the users to prioritize features. When we are eliciting requirements, it ......
Tom Hollander is running a
user survey for Enterprise Library again. This is your chance to complain, suggest, give kudos, etc. about the EL. He’s requesting users that have completed a project using the Enterprise Library. The survey can be found
here and will take about 15 minutes to complete.
WDriven is a Microsoft WORD document template integrated with Microsoft Team Foundation Server. It enables you to communicate and collaborate on Visual Studio 2005 Team System projects from within Microsoft Word. Through VSTS Smart Tags, you can add/edit/track work items. Tables of Items gives you an overview on all the works items referred by your documents. WDriven doesn't impose any special format on your word documents. You can add Work Item Tracking to your existing regular doucment easily. ......
Another good article on CodeProject by Anoop Madhusudanan. This one on Design Patterns. The intro just draws you in immediately: Solution Architect: "But you can use patterns" Dumb Developer: "Yes, But can I get it as an ActiveX control?" Anyway, as he says: In this entire article, you will go through the following steps You will model a very simple football game engine You will identify the design problems in your football game engine You will decide which patterns to use for solving your design ......
Ok, I’m a geek. I admit it. And I read voraciously about just about anything technical under the sun. There are few things that I read that make my head hurt and make me want to take the time to go really slow and make sure I understand everything completely. One is the book Object Thinking by David West. I keep meaning to do a chapter-by-chapter review of this book. Hopefully that will happen in the next few weeks. But the head-hurting documents I’m discussing now is the series on BrainNet ......
What’s missing from .NET development? A good scripting language. Well, there’s one on CodeProject: C# Script. The article on CodeProject describes version 1.1.0 of the app, and it’s now up to 1.6.0. Anyway, this is a very slick utility if you’re doing any scripting, and worth a look. This article describes a "script engine" for the C# language. Here are some of the key features of the presented scripting system: Based on the full featured C#. Full access to CLR and CTS. Can ......
Then you should probably look at this. It’s similar to the CmdHere PowerToy, but more flexible: As a utility: CMDCMX allows you to open a command window with the current working directory set to the folder you right-clicked on in Explorer. CMDCMX also allows you to copy both the long and short versions of a file, or folder path to the clipboard from within Explorer. Lastly, CMDCMX allows you to easily launch executable files with command line arguments from within Explorer. Since it’s ......
Scott Sehlhorst has another good blog post on Functional Testing over at Tyner Blain. Actually, this is part of a larger Foundation Series which is all good. Anyway, in this post, he covers what’s right and wrong with both unit testing and functional (system) testing, and how to get the most out of each. Highly worth a read. ......
…Ok, not really. I’ve been home most of the last couple months, but I haven’t been blogging. I’m going to try to start catching up with some thoughts in the next few weeks. One thing I noticed right away is that this weekend marks the 25th anniversary of the IBM PC. So, happy birthday PC. Thanks for 25 years of h***. ;-) Seriously, all of our lives have been impacted by this, whether you’re a PC user or not. 25 years ago when I was playing with my TRS-80 and learning ......