c# - Added Comma when Printing DataTable as String -



c# - Added Comma when Printing DataTable as String -

in next code passing through every element of datatable , adding string.

foreach(datacolumn column in table.columns) { if (firstpass) { firstpass = false; continue; } toreturn += column.columnname + ","; } toreturn += ";"; firstpass = true; foreach (datarow row in table.rows) { foreach (datacolumn column in table.columns) { if (firstpass) { firstpass = false; continue; } toreturn += row[column].tostring() + " "; } firstpass = true; } homecoming toreturn;

result:

"cad,celiac,hypertension,anticoagulates,ace inhibitors,insulin,;176 25 296 109 73 " + "353 195 18 300 92 73 377 "

can explain why string returned function has concatenation operator (plus sign)? trying create comma delimited string causing problems when interpret string in different class.

wcf test client breaks string , concatenates display in "value" column. see previous question: wcf test client breaks string value

c# sql-server datatable

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -