title: ASP.NET OleDbConnection Problem
body: <p>I'm working on an ASP.NET website where I am using an asp:repeater with paging done through a VB.NET code-behind file. I'm having trouble with the database connection though. As far as I can tell, the paging is working, but I can't get the data to be certain.</p>
  
  <p>The database is a Microsoft Access database. The function that should be accessing the database is:</p>
  
  <pre><code>Dim pagedData As New PagedDataSource
  
  Sub Page_Load(ByVal obj As Object, ByVal e As EventArgs)
      doPaging()
  End Sub
  
  Function getTheData() As DataTable
      Dim DS As New DataSet()
      Dim strConnect As New OleDbConnection("Provider = Microsoft.Jet.OLEDB.4.0;Data Source=App_Data/ArtDatabase.mdb")
      Dim objOleDBAdapter As New OleDbDataAdapter("SELECT ArtID, FileLocation, Title, UserName, ArtDate FROM Art ORDER BY Art.ArtDate DESC", strConnect)
      objOleDBAdapter.Fill(DS, "Art")
  
      Return DS.Tables("Art").Copy
  End Function
  
  Sub doPaging()
      pagedData.DataSource = getTheData().DefaultView
      pagedData.AllowPaging = True
      pagedData.PageSize = 2
  
      Try
          pagedData.CurrentPageIndex = Int32.Parse(Request.QueryString("Page")).ToString()
      Catch ex As Exception
          pagedData.CurrentPageIndex = 0
      End Try
  
      btnPrev.Visible = (Not pagedData.IsFirstPage)
      btnNext.Visible = (Not pagedData.IsLastPage)
  
      pageNumber.Text = (pagedData.CurrentPageIndex + 1) &amp; " of " &amp; pagedData.PageCount
  
      ArtRepeater.DataSource = pagedData
      ArtRepeater.DataBind()
  End Sub
  </code></pre>
  
  <p>The ASP.NET is:</p>
  
  <pre><code>&lt;asp:Repeater ID="ArtRepeater" runat="server"&gt;
      &lt;HeaderTemplate&gt;
          &lt;h2&gt;Items in Selected Category:&lt;/h2&gt;
      &lt;/HeaderTemplate&gt;  
      &lt;ItemTemplate&gt;
          &lt;li&gt;
              &lt;asp:HyperLink runat="server" ID="HyperLink"
                  NavigateUrl='&lt;%# Eval("ArtID", "ArtPiece.aspx?ArtID={0}") %&gt;'&gt;
                  &lt;img src="&lt;%# Eval("FileLocation") %&gt;"
                      alt="&lt;%# DataBinder.Eval(Container.DataItem, "Title") %&gt;t"/&gt; &lt;br /&gt;
                  &lt;%# DataBinder.Eval(Container.DataItem, "Title") %&gt;
              &lt;/asp:HyperLink&gt;
          &lt;/li&gt;
      &lt;/ItemTemplate&gt;
  &lt;/asp:Repeater&gt;
  </code></pre>