I'm trying to break a string which comes from SQL to 4 columns and send it to view.
Here is how I'm getting the string from sql:
"ISLAND CONSTRUCTION \nISCON1 \nPO BOX 1210\n 35 BERNARD DR \n3239337"
I divided it by 4 columns as you can see above,
Now I'm trying to loop it 4 time and send it to show in view:
var x = aldb.ERPJournala(refid, trantype, batcnum).FirstOrDefault();
for (int i = 0; i < x.BillTo.Length; i++)
if (i > 4)
jr.Billto = x.BillTo.Split('\n')[i];
So far everything works fine I query the billTo and split it to 4 columns.
Now I don't know what to do at my view side:
Here below you can see what I'm doing:
<div class="col-md-3 col-sm-3 col-xs-3">
@for (int i = 0; i < Model.Billto.Length; i++)
The issue is that I'm getting just the last split like the last column.
I think my issue is the code in the view side.