Ok, so I did some research and I'm sure this site gets asked how to fix this error at least once a day. However, I attempted to debug but I still consider myself a novice at programming and am unable to solve this error after researching it. Here is the following code in C#:
DataSet set2 = new DataSet(); //Here, the DataSet is being created
clsData data2 = new clsData();
set2 = data2.getData("SELECT * FROM TBLREFDES WHERE reportnote like '%must installed%'"); //Here, the DataSet is being set to something so it is no longer null
int num94 = (set2.Tables[0].Rows.Count - 1); //Here is where the error "Object reference not set to an instance of an object" occurs
I have used an if statement to double check that both variables "set2" and "data2" are not null, and they aren't. Any help will be greatly appreciated.