Unable to cast object of type 'system.data.datatable' to type
<p>I have a datatable AVT of type AvailDataTable.  The following code works to create a new datatable from AVT:</p>

<pre><code>AvailDataTable AVT1 = (AvailDataTable) AVT.DefaultView.Table;
</code></pre>

<p>However, the code:</p>

<pre><code>AvailDataTable AVT1 = (AvailDataTable) AVT.DefaultView.ToTable();
</code></pre>

<p>fails with the message "Unable to cast object of type 'system.data.datatable' to type 'AvailDataTable'.</p>

<p>Can someone explain why the first cast works but the second one doesn't?  Thanks!</p>
