My Blog

ADO.NET's DataAdapters and Opened Connections
ADO.NET's DataAdapters and Opened Connections
October 14, 2002

I have been reviewing a bunch of code that utilizes ADO.NET's DataAdapters. This code has been some samples that are on the Internet, some questions directly to http://wildermuth.com and others from DevelopMentor's .NET Mailing Lists. One thing I have noticed is that much of that code is opening the database connection before using the DataAdapter to fill a DataSet.

Why "Service.asmx?wsdl" Doesn't Work...
Why "Service.asmx?wsdl" Doesn't Work...
October 11, 2002

I just attended the second day of Chris Sells' and Tim Ewald's great Web Services DevCon East and had a great time. Yasser Shohoud gave a wonderful talk on "The Right Way to Build Web Services". He echoed something I have been thinking of for some time. Sure, I didn't want to learn how to write WSDL. At the same time I know that the WSDL that is generated by using the '?wsdl' syntax of ASP.NET's .asmx files does not let me design the interface first. I changed my mind and learned to write WSDL. WSDL really isn't too difficult to write. It is too bad that we cannot disable the ?wsdl syntax and just use a static WebService.WSDL URL to have our customer's get our WSDL files.

Web Services and DataSets: Why the Bad Rap?
Web Services and DataSets: Why the Bad Rap?
October 10, 2002

Why is everyone so down on using DataSets in .NET Web Services? Sure, I’ll admit that using DataSets directly as Web Service parameters are indeed a problem. But why throw the baby out with the bath water?

Serializing XmlDocuments in the .NET Framework
Serializing XmlDocuments in the .NET Framework
August 25, 2002

I was recently in a DevelopMentor course when I ran into a very interesting observation.  The XmlSerializer serializes any class that dervies from XmlNode (including XmlDocument, XmlElement, et al) as plain XML.  Previous to RTM of the .NET framework, these classes were serialized like any other class (all public properties and fields were serialized).  To our amazement (Dan Sullivan and mine), we realized that the XML classes serialized perfectly when run through the XmlSerializer class.

Is XML Just Structured Storage?
Is XML Just Structured Storage?
July 29, 2002

When the XML revolution happened, I was surprised how quickly developers jumped on to the coming tide.  I have to admit, the first time I saw XML, I believed it was nothing more than just structured storage. That is the magic of it, isn't it.  It is just structured storage, but a structured storage format that is universally understood. 

XmlDataDocument is Cool
XmlDataDocument is Cool
June 5, 2002

For those who do not know yet, the XML integration with the DataSet is very powerful. Most of the integration is about filling and getting XML from your DataSet. But the XmlDataDocument is really cool. Simply by assigning the DataSet to the XmlDataDocument, you can work with the DataSet data either relationally (through the DataSet) or hierarchically (through the XmlDocument). So, next time you need to transform the DataSet data or just run an XPath query, assign your DataSet to an XmlDataDocument and watch the magic begin...

Firehose your RecordSets
Firehose your RecordSets
May 28, 2002

Too many times when I am asked to look at old ADO code, the recordsets are created with a slower cursor than they actually need. This especially prevalent in ASP code. In most every piece of ASP code, the job of the page is to report existing data. In that case you should always us a adOpenForwardOnly cursor. Remember, if you are only reading the data, the other cursor types are using extra database resources and will cause extra round trips to the database. If you are using other cursors just to enable being able to go backwards in the recordset, it is almost always better to use the adOpenForwardOnly cursor and cache the data locally to allow for reverse transversal.

ADO's Parameters.Refresh() is evil
ADO's Parameters.Refresh() is evil
May 16, 2002

Am I the only that abhors this dreadful API? I understand the usefulness of using Parameters.Refresh() during development. The problem lies in the fact that is it just too easy to leave the code in place. Including an extra network round-trip in every call to this call is simply a waste of time. Now I know that you are an intelligent programmer that never wouldn never leave that code in place, I am talking about all the other programmers that would. Most databases (ignoring Access) allows you to query the database for the information about parameters. Since the database supports, why does ADO have to? I don't think it does.

DataSets are IMDB, Almost
DataSets are IMDB, Almost
May 7, 2002

Anyone else remember the promised "In-Memory Database" (IMDB) that was to be part of COM+ some years back? Well, Microsoft has finally delivered a first version of it in ADO.NET's DataSet class.

Let the Database Do Its Job
Let the Database Do Its Job
April 24, 2002

Ok, this pet peeve is a biggie. Over and over I have seen database schemas that simply defined the table structures and some stored procedures. Most modern database systems support advanced features for maintaining database integrity.

Remember That Those Connections are Precious
Remember That Those Connections are Precious
April 11, 2002

The most common error I see in badly scalable database code is reckless use of the connection object. For all multi-user database programming (which accounts for most of the work these days), database connections are a limited resource. Don't let it be your code that is hanging on to his connection way after you are finished with it. I am *not* saying that all work can be done disconnected. I am simply asking you to keep in mind that Connections are precious things. Try to do these two things: