Object Reference Error filling a datarow

Posted by JPJedi on Stack Overflow See other posts from Stack Overflow or by JPJedi
Published on 2010-02-23T22:22:00Z Indexed on 2010/03/25 20:53 UTC
Read the original article Hit count: 432

This is the code:

Dim dr() As DataRow = DataSet.Tables("TableName").Select("EVENTNAME = '" & name & "'")

I get an "Object reference not set to an instance of an object." Error when this line is executed. It is looping through a list of selected items in a listbox. I think it has to do with how I have the datarow declared because I can look at the name and I see it ok and I also do a null check on the name before I use it.

Visual Studio 2008, VB.NET. Any ideas?


Yep it was a wrong table name. I guess after looking at the code for 8 hours that minor detail I just wasn't thinking to check. Thanks!

© Stack Overflow or respective owner

Related posts about datarow

Related posts about dataset