Note that there are some explanatory texts on larger screens.

plurals
  1. POLarge String seems to wrap when I dont want it to
    primarykey
    data
    text
    <p>I am creating a long string in my c# application. I want it to stay on one line as these are the headers for fields the user has selected to update in the database. The string will be used in a log file.</p> <p>When I select all the fields to be updated it seems that the string is to long to be displayed in a single line and is automatically wrapped.</p> <p>I am confused as textfile should be able to handle a string of any length (Memory permitting) without wrapping.</p> <p>It seems that once the string gets longer than about 1050 characters it does an Automatic wrap.</p> <p>My code is below:</p> <pre><code>private void UpdateCustomer(string pCurrentFileName, ref StringBuilder log, string date, ref string directoryPath, ref string logFilePath) { // set the logfile paths for customer update directoryPath = Path.Combine(pLogFilePath, "CustomerUpdate_Log_" + date.Replace("/", "").Replace(" ", "").Replace(":", "")); logFilePath = Path.Combine(directoryPath, "CustomerUpdate.log"); DataSet customerUpdateDataSet = new CustomerUpdateValidator().ImportCustomersForUpdateFromExcelFileToDataSet(pCurrentFileName); log.Append("-------------------------------------------------------------------------" + "\r\n"); log.Append("Bulk Maintenance Log: Customer Updatess" + "\r\n"); log.Append("-------------------------------------------------------------------------" + "\r\n"); log.Append(date + "\r\n\r\n"); log.Append("Total number of Customer to be updated: " + (customerUpdateDataSet.Tables["CustomerData"].Rows.Count - 2).ToString() + "\r\n\r\n"); log.Append("Data to be Inserted" + "\r\n"); log.Append("-".PadRight(300, '-') + "\r\n\r\n\r\n"); StringBuilder header = new StringBuilder("Row".PadRight(10, ' ') + "\t"); header.Append("URN".PadRight(40, ' ') + "\t"); int count = 0; // for each row in the grid view for (int i = 0; i &lt; this.gridView1.DataRowCount; i++) { // if the value is checked if (Convert.ToBoolean(this.gridView1.GetRowCellValue(i, "CheckMarkSelection"))) { // get the fields from the checked column string baxiDescription = this.gridView1.GetRowCellValue(i, "SimpleName").ToString(); int size = getSizeFromType(this.gridView1.GetRowCellValue(i, "Type").ToString()); header.Append(baxiDescription.PadRight(size, ' ') + "\t"); count = i; } } header.Append("Result".PadRight(10, ' ') + "\t"); header.Append("Reason".PadRight(30, ' ') + "\t"); log.Append(header.ToString() + "\r\n"); log.Append(new StringBuilder("-".PadRight(header.Length + 60, '-') + "\r\n")); } </code></pre> <p>Any ideas why this is happening?</p> <p><img src="https://i.stack.imgur.com/Bw4a5.jpg" alt="My DataSet"> <img src="https://i.stack.imgur.com/N7Qd5.jpg" alt="Wrapped LogFile"></p> <p>Regards,</p> <p>Iain</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload