My guess ( since there´s little information given ) :
Code:
DataSet ds = new DataSet();
ds.Tables[table].Rows.Add(dr);
Are you sure there are Tables in the object ds ?
My second guess is:
Code:
public void updateDataRow(DataRow dr)
ds.Tables[table].Rows.Add(dr);
Are you sure that the Datarow object that is being passed as a parameter ( in updateDateRow signature ) is actually referencing to something ?
A quick way to check these things is to do something like
Code:
public void updateDataRow(DataRow dr) {
if(dr.Equals(null)) {
Console.WriteLine("dr -> null");
}
//rest of code goes here.
}