title: vb.net dataview populated by sql
body: <p>I'm trying to load the data from an sql query into a datatable which will load a GridView. See code below...</p>
  
  <pre><code>    Dim dv As New System.Data.DataView
      Dim dt As New System.Data.DataTable
  
      dv = SQL_Week.Select(DataSourceSelectArguments.Empty)
      dt = dv.ToTable()
  
      GV_WeekData.DataSource = dt
      GV_WeekData.DataBind()
  </code></pre>
  
  <p>If I run this code the Gridview appears empty. If I debug the code, when I get to dv = SQL_Week, I can pull the sql statement and if I run it in sql server I get the data that I need, but if I look at the contents of 'dv' it show a reference to 11 columns . </p>
  
  <p>If I add the following code I can actually see that there is data in the datatable.
            Dim test As String = dt(1)(1)</p>
  
  <p>The funny thing is that in another page, similar query and code works perfectly. It is driving me mad</p>
  
  <p>Any ideas will be appreciated.</p>
  
  <p>Thanks</p>