<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title /><link>http://enerlinx.com/blog/category/2.aspx</link><description /><managingEditor>Chad Albrecht</managingEditor><dc:language>en-US</dc:language><generator>.Text Version 0.95.2004.102</generator><item><dc:creator>Chad Albrecht</dc:creator><title>BLInk</title><link>http://enerlinx.com/blog/archive/2006/02/08/335.aspx</link><pubDate>Wed, 08 Feb 2006 00:00:00 GMT</pubDate><guid>http://enerlinx.com/blog/archive/2006/02/08/335.aspx</guid><wfw:comment>http://enerlinx.com/blog/comments/335.aspx</wfw:comment><comments>http://enerlinx.com/blog/archive/2006/02/08/335.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://enerlinx.com/blog/comments/commentRss/335.aspx</wfw:commentRss><trackback:ping>http://enerlinx.com/blog/services/trackbacks/335.aspx</trackback:ping><description>&lt;html&gt;&lt;head&gt;&lt;/head&gt;
&lt;body&gt;Test from Julie Lerman's &lt;a href="http://www.thedatafarm.com/blog/CategoryView.aspx?category=BLInk!"&gt;BLInk!&lt;/a&gt;&lt;/body&gt;&lt;/html&gt;&lt;img src ="http://enerlinx.com/blog/aggbug/335.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Chad Albrecht</dc:creator><title>DataReader vs. DataAdapter</title><link>http://enerlinx.com/blog/archive/2005/08/25/229.aspx</link><pubDate>Thu, 25 Aug 2005 09:45:00 GMT</pubDate><guid>http://enerlinx.com/blog/archive/2005/08/25/229.aspx</guid><wfw:comment>http://enerlinx.com/blog/comments/229.aspx</wfw:comment><comments>http://enerlinx.com/blog/archive/2005/08/25/229.aspx#Feedback</comments><slash:comments>5</slash:comments><wfw:commentRss>http://enerlinx.com/blog/comments/commentRss/229.aspx</wfw:commentRss><trackback:ping>http://enerlinx.com/blog/services/trackbacks/229.aspx</trackback:ping><description>Recently I've had discussions with a few people about the pros and cons of using DataAdapter.Fill() vs. using the DataReader.  First let's take a look at how DataAdapter.Fill() works.  Here is the basic code:&lt;br /&gt;
&lt;pre&gt;
try
{
        DbDataAdapter.QuietOpen(connection1, out state1);
        using (IDataReader reader1 = command.ExecuteReader(behavior | CommandBehavior.SequentialAccess))
        {
            if (data is DataTable)
            {
                    return this.Fill((DataTable) data, reader1);
            }
            return this.Fill((DataSet) data, srcTable, reader1, startRecord, maxRecords);
        }
}
finally
{
        DbDataAdapter.QuietClose(connection1, state1);
}
&lt;/pre&gt;&lt;br /&gt;
With the guts looking something like this:
&lt;pre&gt;
this.dataReader.GetValues(this._readerDataValues);
object[] objArray1 = this.GetMappedValues();
DataRow row1 = this.dataTable.LoadDataRow(objArray1, acceptChanges);

private void MappedValues()
{
      int num1 = this._mappedLength;
      for (int num2 = 0; num2 &amp;lt; num1; num2++)
      {
            this._mappedDataValues[num2] = this._readerDataValues[num2];
      }
}
 

&lt;/pre&gt;&lt;br /&gt;
So what is Fill() doing? It's using a DataReader to deserialize the data stream into a DataSet.  How is this different than using a DataReader?  The point is, it's not.  There are just more steps to get the data deserialized into the DataSet and the DataSet consumes memory.  If all you want is a discrete value from the database, i.e. a single column from a single row, then using a DataReader is going to give you better performance.  What if you want the flexibility of holding a collection of rows, being able to sort and filter the rows and serialize the data?  You have 2 choices at this point, use a DataSet or write set of custom objects to handle this.  If you plan on giving your objects the capability of using INSERT,SELECT, UPDATE and DELETES (CRUD) on the database, you've got your work cut out for you.   &lt;a href="http://www.adapdev.com/"&gt;Sean McCormack&lt;/a&gt; does a nice job of demonstrating how much work is required in his &lt;a href="http://www.adapdev.com/codus/index.aspx"&gt;Codus&lt;/a&gt; tool.  A fellow blogger &lt;a href="http://codebetter.com/blogs/sahil.malik/archive/2005/01/28/48711.aspx"&gt;Sahil Malik&lt;/a&gt;, does a nice job comparing and contrasting the use of the two.  Here is a quote from his entry that somes it up nicely:&lt;br /&gt;

&lt;p&gt;
&lt;quote&gt;&lt;i&gt;Even if you built an app that is built on datareaders only, you WILL EVENTUALLY find yourself create your own home grown business object implementation, that has the ability to store data in a disconnected form. And chances are - it will be not as feature rich as a dataset, it will not gain all the free enhancements future versions of .NET bring over, and it will probably be buggy and your developers won't be willing to learn it even.&lt;/i&gt;&lt;/quote&gt;
&lt;/p&gt;&lt;img src ="http://enerlinx.com/blog/aggbug/229.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Chad Albrecht</dc:creator><title>Simple C# TFTP server</title><link>http://enerlinx.com/blog/archive/2005/05/17/168.aspx</link><pubDate>Tue, 17 May 2005 12:07:00 GMT</pubDate><guid>http://enerlinx.com/blog/archive/2005/05/17/168.aspx</guid><wfw:comment>http://enerlinx.com/blog/comments/168.aspx</wfw:comment><comments>http://enerlinx.com/blog/archive/2005/05/17/168.aspx#Feedback</comments><slash:comments>10</slash:comments><wfw:commentRss>http://enerlinx.com/blog/comments/commentRss/168.aspx</wfw:commentRss><trackback:ping>http://enerlinx.com/blog/services/trackbacks/168.aspx</trackback:ping><description>A few of my embedded devices around the office use TFTP as a means of upgrading their firmware.  Since I wanted some control of what/how these firmware files got sent, I wrote a C# class to act as a TFTP server.  It's pretty simple and still needs work, but here it is: &lt;a href="http://enerlinx.com/blog/Uploads/TFTPServer.txt" title="TFTPServer.cs"&gt;TFTPServer.cs&lt;/a&gt;
&lt;br /&gt;You'll also want to get the zip file, as it has the ExTrace support.&lt;a href="http://www.enerlinx.com/TFTPServer.zip" title="TFTPServer.zip"&gt;TFTPServer.zip&lt;/a&gt;&lt;img src ="http://enerlinx.com/blog/aggbug/168.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Chad Albrecht</dc:creator><title>Kinda Spooky</title><link>http://enerlinx.com/blog/archive/2005/03/14/167.aspx</link><pubDate>Mon, 14 Mar 2005 10:42:00 GMT</pubDate><guid>http://enerlinx.com/blog/archive/2005/03/14/167.aspx</guid><wfw:comment>http://enerlinx.com/blog/comments/167.aspx</wfw:comment><comments>http://enerlinx.com/blog/archive/2005/03/14/167.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://enerlinx.com/blog/comments/commentRss/167.aspx</wfw:commentRss><trackback:ping>http://enerlinx.com/blog/services/trackbacks/167.aspx</trackback:ping><description>So it turns out that Travis and I worked with Terry Ratzmann, the guy who went postal on Saturday in the Brookfield Sheraton.  He was socially quirky but I would have never thought he would do something like this.  (Isn't that what everyone says!)&lt;img src ="http://enerlinx.com/blog/aggbug/167.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Chad Albrecht</dc:creator><title>Undo vs. Are you sure?</title><link>http://enerlinx.com/blog/archive/2005/02/09/163.aspx</link><pubDate>Wed, 09 Feb 2005 15:14:00 GMT</pubDate><guid>http://enerlinx.com/blog/archive/2005/02/09/163.aspx</guid><wfw:comment>http://enerlinx.com/blog/comments/163.aspx</wfw:comment><comments>http://enerlinx.com/blog/archive/2005/02/09/163.aspx#Feedback</comments><slash:comments>5</slash:comments><wfw:commentRss>http://enerlinx.com/blog/comments/commentRss/163.aspx</wfw:commentRss><trackback:ping>http://enerlinx.com/blog/services/trackbacks/163.aspx</trackback:ping><description>In the March 2005 issue of msdn magazine David S. Platt writes: "Provide undo, not confirmation."  The editorial on page 140 elegantly states what I have been preaching for years.  Thanks David!   &lt;a href="http://msdn.microsoft.com/msdnmag/issues/05/03/default.aspx" title="{End Bracket}"&gt;{End Bracket}&lt;/a&gt;&lt;img src ="http://enerlinx.com/blog/aggbug/163.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Chad Albrecht</dc:creator><title>Homebuilt Abrasive water jet</title><link>http://enerlinx.com/blog/archive/2004/10/07/156.aspx</link><pubDate>Thu, 07 Oct 2004 14:08:00 GMT</pubDate><guid>http://enerlinx.com/blog/archive/2004/10/07/156.aspx</guid><wfw:comment>http://enerlinx.com/blog/comments/156.aspx</wfw:comment><comments>http://enerlinx.com/blog/archive/2004/10/07/156.aspx#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://enerlinx.com/blog/comments/commentRss/156.aspx</wfw:commentRss><trackback:ping>http://enerlinx.com/blog/services/trackbacks/156.aspx</trackback:ping><description>I've been screwing around with building an abrasive waterjet for cutting sheetmetal.  The concept is fairly simply, accelerate abrasive particles (garnet or silica sand) to a high velocity using water and slam them into the material you want to cut.  A useful site for understanding waterjets is the &lt;a href="http://www.waterjets.org" title="Waterjet Web Reference"&gt;Waterjet Web Reference&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
So I did some calculations and built a cutting head for use with my 1400 psi pressure washer and 40lbs. sand blaster...alas it was not enough water pressure to accelerate the particles adequately.&lt;br /&gt;
&lt;br /&gt;
Here is a picture of the head I designed and built:&lt;br /&gt;
&lt;img src="http://www.enerlinx.com/blog/Uploads/WaterJetHead.png" alt="Waterjet head" width="329" height="247" border="0" /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is a picture of the finished unit:&lt;br /&gt;
&lt;img src="http://www.enerlinx.com/blog/Uploads/Image004.jpg" border="0" /&gt;
&lt;img src ="http://enerlinx.com/blog/aggbug/156.aspx" width = "1" height = "1" /&gt;</description></item></channel></rss>