Here are two lines of your code: Dim table As DataTable = Nothing da.Fill(table). You have no code in between that assigns an object to that table variable..