title: I am getting Error "There is no row at position 0" from code below
body: <pre><code>Private Sub Button3_Click (ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
  
      If txtID.Text = "" Then
          MsgBox("Please input a valid Employee code to load a corresponding record", MsgBoxStyle.Information)
      Else
          dbProvider = "Provider=Microsoft.Ace.OLEDB.12.0;"
          dbSource = "Data Source = C:\Users\Blessing\Documents\IBCARIP.accdb;Persist Security Info=False"
          con.ConnectionString = dbProvider &amp; dbSource
          con.Open()
          sql = "select * from Calculator where " _
              &amp; "EmpCode = " &amp; " '" &amp; txtID.Text &amp; "'"
  
          da = New OleDb.OleDbDataAdapter(sql, con)
          da.Fill(ds, "IBCARIP")
          lblSAI.Text = ds.Tables("IBCARIP").Rows(inc).Item("SName") &amp; ds.Tables("IBCARIP").Rows(inc).Item("FName")
          lblRate.Text = ds.Tables("IBCARIP").Rows(inc).Item("NRate")
          lblOT.Text = ds.Tables("IBCARIP").Rows(inc).Item("OTRate")
          lblBnk.Text = ds.Tables("IBCARIP").Rows(inc).Item("BName") &amp; ".." &amp; ds.Tables("IBCARIP").Rows(inc).Item("ANumber") &amp; ".." &amp; ds.Tables("IBCARIP").Rows(inc).Item("AType")
          con.Close()
          ds.Tables("IBCARIP").DataSet.Clear()
          MaxRows = ds.Tables("IBCARIP").Rows.Count
          'inc = 0
      End If
  End Sub
  </code></pre>
  
  <p>The message comes when i enter a wrong or non-existent Employee code in txtID.text</p>
  
  <p>how can i solve tha problem</p>