Try
EPPlus.
Otherwise, looking at the code, I am puzzled.
You are trying to add a row to dt, which isn't initialised in the code you have shown.
Then in the comment afterwards you note that ds.Tables[0]= null. if dt = ds.Tables[0] (= null) then you definitely will fail to add a row to it.
Stumbling in the dark until you give us more information though.