I'm getting an error msg on this line:

For Each dr In ds.Tables("cards").Rows

I have data in my grid, not sure why I'm getting this msg.

An unhandled exception of type 'System.NullReferenceException' occurred in pcms.exe

Additional information: Object reference not set to an instance of an object.

VB Code:
  1. Dim cmdView As OleDb.OleDbDataAdapter = New OleDb.OleDbDataAdapter("select item_no, activity, account_no from pcms.pcms_item_activity where item_no='" & txtItem.Text & "' and activity='" & txtActivity.Text & "'", objCon)
  2.         ds = New DataSet()
  3.         cmdView.Fill(ds, "cards")
  4.         DataGrid1.DataSource = ds
  5.         DataGrid1.DataMember = "cards"
  6.         objCon.Close()
  7.  
  8.  Dim dr As DataRow
  9.         For Each dr In ds.Tables("cards").Rows
  10.             MsgBox("Whatever")
  11.         Next