steven lim

steven lim

  • NA
  • 2
  • 5.2k

how to split a data and add column?URGENT!!!HELP!!!

Sep 24 2010 3:57 AM

i got a data like tis 1(0-AGF-MYR-100101i wan split to 4 part (0 , AGF, MYR ,100101)
and after tis i nid to add 4 new columns to a datatable to display the value!
how nid i do???
 
Dim writer As StreamWriter = File.CreateText("D:\ IMS.csv")
For i As Integer = 1 To ds.Tables(0).Columns.Count - 1
writer.Write(ds.Tables(0).Columns(i))
If i < ds.Tables(0).Columns.Count - 1 Then
writer.Write(
",")
End If
Next
writer.Write(writer.NewLine)
For Each dr As DataRow In ds.Tables(0).Rows
For i As Integer = 0 To ds.Tables(0).Columns.Count - 1
If Not Convert.IsDBNull(dr(i)) Then
writer.Write(dr(i).ToString())
End If
If i < ds.Tables(0).Columns.Count - 1 Then
writer.Write(
",")
End If
Next
writer.Write(writer.NewLine)
Next

Thanks!!!!!!!!!!!!!!!!!!!!1

Answers (1)