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:
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) ds = New DataSet() cmdView.Fill(ds, "cards") DataGrid1.DataSource = ds DataGrid1.DataMember = "cards" objCon.Close() Dim dr As DataRow For Each dr In ds.Tables("cards").Rows MsgBox("Whatever") Next
