I think the problem lies here
DataTable dt = new DataTable(ds.Tables[0].TableName.ToString());
DataRow dr = dt.Rows[0];
although you initiate a new DataTable, it does not yet have any rows. I am not sure what you are trying to achieve overall, but I think you might be looking to do something like this
DataTable dt = ds.Tables[0];
which would make dt equal to the first table in the DataSet.
Hope this helps