It should be noted that SqlClient will not always be faster than reading
an XML document. It depends on the size of the data, the structure, etc,
etc. Also, you have to consider the other factors in play here, namely, is
it appropriate to store this information in the database as opposed to a
config file which is most likely stored locally?
On top of that, it should be noted that calling Dispose on the DataSet
will not mark it for garbage collection. The Dispose pattern on the DataSet
is inherited from the MarshalByValueC omponent class, and the DataSet does
nothing to override that behavior. The only thing that calling Dispose on
the DataSet does is fire the Disposed event.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard. caspershouse.co m
"Carl" <cz******@gmail .com> wrote in message
news:11******** **************@ u72g2000cwu.goo glegroups.com.. .
Jason,
ReadXML must parse the entire XML document before it can represent it
in a relational-like format, which uses a lot resources for large
documents. The SqlClient method will always be faster. There are a
number of ways to improve performance with XML data, see
http://msdn.microsoft.com/library/de...netchapt09.asp,
but I'm not sure these recomendations will help ReadXML.
Once your DataSet goes out of scope or you call Dispose() it will be
marked for garbage collection and the memory will be reclaimed.
-Carl