Without you telling us exactly which line the error is coming from, it's difficult to be precise, but probably you need to look at the return value from
MOLDBAccess.ExecuteDataSet
, then at
grdupload
. They are the only variables which you do not show being declared or initialised before you use them, so one or other of them will be null - but I can't tell which from here.
Run your code in the debugger, and either put a breakpoint on the
DataSet ds = new DataSet();
line and step through, looking at your variables at each step, or run it until the exception occurs and look at the variable it is complaining about.
You will then have to work out why it is null - but that is outside the scope of the code you have shown us.