title: Unable to cast object of type 'System.Data.DataView' to type 'System.Data.IDataReader'
body: <p>I have a function (on vb.net) to get a data from a XMLWebService:</p>
  
  <pre><code>Private Function GetDataSchedule() As DataTable
      Dim xTable As Data.DataTable
      xTable = xMaster.GetSchedule()
  
      'Bind to DataTable
      Dim DT As New System.Data.DataTable
      DT.Load(xTable.DefaultView) '--&gt; When I set a breakpoint, the error start from here
  
      Return DT
  End Function
  </code></pre>
  
  <p>And then the function to call the <code>GetDataSchedule()</code> Function:</p>
  
  <pre><code>Public Sub ShowDataSchedule()
      Dim DSSchedule As New System.Data.DataSet
      DSSchedule.Tables.Add(GetDataSchedule) 
  
  End Sub
  </code></pre>
  
  <p>But then when I executed the code, it results on get the error message:
  <code>Unable to cast object of type 'System.Data.DataView' to type 'System.Data.IDataReader'.</code></p>
  
  <p>When I just execute the <code>GetDataSchedule()</code> Function, it return value, but when I make it separately to call the function, then it got error. Am I missing something? Need your help. Thanks...</p>