wen i write the data to notepad,i get the result below:
<SRT>,160,161,
NEW,1001,1001,CAAB IMS,OTHER,31-12-07,MYR,28-09-10,1111,A,4127288.4600,0.0000,31-12-07,0,AGF,MYR,100101
NEW,1001,1001,CAAB IMS,OTHER,31-12-07,MYR,28-09-10,1111,A,175000.0000,0.0000,31-12-07,0,AGF,MYR,102101
<END>,4302288,
wat i wan is like below:
<SRT>,160,161
NEW,1001,1001,CAAB IMS,OTHER,31-12-07,MYR,28-09-10,1111,A,4127288.4600,0.0000,31-12-07,0,AGF,MYR,100101
NEW,1001,1001,CAAB IMS,OTHER,31-12-07,MYR,28-09-10,1111,A,175000.0000,0.0000,31-12-07,0,AGF,MYR,102101
<END>,4302288
i don't wan (,) behind 161 and 4302288
Hope hav sum1 can answer my question.Thanks...
For Each row In dt.Rows
For i = 0 To dt.Columns.Count - 1
If Not Convert.IsDBNull(row(i)) Then
writer.Write(row(i).ToString())
End If
If row(i).ToString <> "" Then
If i < dt.Columns.Count - 1 Then
writer.Write(",")
End If
End If
Next
writer.Write(writer.NewLine)
Next
writer.Close()