While running the code below I receive the following error object reference not set to an instance of an object, from my understanding this has to do with the initialization of objects, anyone able to see where I went wrong?
[MAIN]
m_Remote = new Remote(Count, iMachines);
System.Data.DataSet oRecs = new System.Data.DataSet();
oRecs = m_Remote.Read;
m_Remote.Setinfo(oRecs, iOIndex, iMIndex); << ERROR OCCURS HERE
[CLASS]
public class Remote
{
public object[,] m_obj;
public Remote(int iO, int iM)
{
object[,] m_obj = new object[iO, iM];
}
public System.Data.DataSet Read()
{
// Create Dataset oRecs dynamically
return oRecs;
}
public void Setinfo (System.Data.DataSet rec, int oIndex, int mIndex)
{
m_obj[oIndex, mIndex] = rec;
}
}
}
[MAIN]
m_Remote = new Remote(Count, iMachines);
System.Data.DataSet oRecs = new System.Data.DataSet();
oRecs = m_Remote.Read;
m_Remote.Setinfo(oRecs, iOIndex, iMIndex); << ERROR OCCURS HERE
[CLASS]
public class Remote
{
public object[,] m_obj;
public Remote(int iO, int iM)
{
object[,] m_obj = new object[iO, iM];
}
public System.Data.DataSet Read()
{
// Create Dataset oRecs dynamically
return oRecs;
}
public void Setinfo (System.Data.DataSet rec, int oIndex, int mIndex)
{
m_obj[oIndex, mIndex] = rec;
}
}
}