In below code u have put FileName=csv as static value and
var columnNames = lstData.Select(k => k.FileName).Distinct();
always returns one value of "csv".
so every time it set the value to same column name. and u needs to
keep
DataRow newrowPassCount = dtoutput.NewRow();
inside foreach loop
let me know if its help or not.