My SQL query retrieves one row of multiple columns. I have stored that in string with ‘|’ separator to differentiate between columns.
And then prints that string in <textarea> field of .aspx page.
My question is there any way in which after that | separator next column comes in next line in textarea? Just like pressing Enter key?
Code:
dtOutput = Generix.getData("dbo.EventMsg E Left Join dbo.ATMStatusHistory A On E.Code=A.Fault", "Distinct E.Fault_Short_Name", "A.Code In (" + sFaultNumber + ") And IsNull(Fault_Short_Name,'')<>''", "", "", 1);
sOtherFaults = "";
foreach (DataRow drOutput in dtOutput.Rows)
{
foreach (DataColumn dcOutput in dtOutput.Columns)
{
sOtherFaults += ((sOtherFaults == "") ? "" : ":") + Convert.ToString(drOutput[dcOutput]);
}
}
sOutput += "|" + sOtherFaults + "|" + sClosedFault + "|" + sTemp + "|";
Response.Write(sOutput);
Try: