ASP.net: Efficient ways to convert DataSets to GenericCollection (Of ObjectType)
<p>I currently have a function that gets some data from the database and puts it into a dataset. The return type on my function is GenericCollection (Of CustomerDetails)</p>

<p>If I do this:</p>

<pre><code>Dim dataset As DataSet = Read(strSQL.ToString) 'Gets Data from DB
</code></pre>

<p>What's the most efficient way to map the dataset results to an collection of objects. More importantly, since I'm using GenericCollection, is there a way to do this in which I can call a function from the ObjectType class (CustomerDetails) that would have a means to converting that specific object. </p>

<p>Or is there a way in which I can use a function that would handle all types?</p>

<p>Is there a way to do something like:</p>

<pre><code>Return returnedResults.TransformDataSet(dataset) 
</code></pre>

<p>In which returnedResults is an object collection Of CustomerDetails, or would it simply be easier to have TransformDataSet return an object collection Of CustomerDetails by itself?</p>

<p>Thanks for any help.</p>
