title: Invalid Cast Exception when filling datatable wth table adaptor
body: <p>I am using VB.NET 2010 (Visual Basic 2010 Express) on a WPF-based project. I am also using the SQL Server Express built-in to Visual Basic 2010 express.</p>
  
  <p>I have just about finished refining my code for hooking up my wpf-based form to an existing SQL database (agentroster.sdf). I have a global data source (AGENT_ROSTER) connected to this database. Connections are confirmed to work properly.</p>
  
  <p>This is the first part of the code I'm using, irrelevant code omitted,</p>
  
  <pre><code>Dim table_adaptor As New AGENT_ROSTERTableAdaptors.AGENT_ROSTERTableAdaptor
  Dim roster_table As New DataTable("roster_table")
  Dim rowposition As Integer
  
  Private Sub ROSTER_Loaded...
     table_adaptor.Fill(roster_table)
  End Sub
  </code></pre>
  
  <p>I am getting the following errors:
  (In Immediate Window)</p>
  
  <blockquote>
    <p>A first chance exception of type 'System.InvalidCastException' occured in VBP-WORD4WORD.exe</p>
  </blockquote>
  
  <p>(In Message, pointing to the line: "table_adaptor.Fill(roster_table)')</p>
  
  <blockquote>
    <p>InvalidCastException was unhandled
    Unable to cast object of type 'System.Data.DataTable' to type 'AGENT_ROSTERDataTable'.</p>
  </blockquote>
  
  <p>What am I doing wrong, and furthermore, how do I fill roster_table with table_adaptor (or alternate method)?</p>