I have a DataTable with the following structure
ATM Fault
---------
A01 34256
A02 56346
A03 98946
How can I store it in one string variable by using pipe delimiter as
string temp="A01|34256,A02|56346,A03|98946";
I was Converting My Linq To DataTable.But i it seems that i can do it in LINQ itself
var diff = dtOpenEvent.AsEnumerable().Except(dtOutputTemp.AsEnumerable(), DataRowComparer.Default);
DataTable di = diff.CopyToDataTable();//This is the Datatable which i want to Convert
How Can i achieve same by modifying only var diff statement so that there is no need to convert it in DataTable
You can first concat the
ATMandFaultpairs with a pipe and thenjointhem with comma: