I just want to add List as a DataTable entire row. here is the code which I have tried.
private static DataTable _table = new DataTable();
List<string> tempList = new List<string>();
// tempList = {"A1","A2","A3","A4","A5","A6"}
_table.Rows.Add(tempList);
Expected output:
col1|col2 |col3 |col4 |col5| col6
----+-----+-----+------+----+--
row1 A1 | A2 | A3 | A4 | A5 | A6
However this is not working for me. It will insert data collection to first column.
Actual output:
col1 |col2 |col3 |col4 |col5| col6
----------+-----+-----+------+----+--
row1 A1,A2,A3.| | | | |
Please help me to Add entire row using list. thank you