johnnykenshien
Member
- Joined
- Jun 6, 2008
- Messages
- 9
- Programming Experience
- Beginner
hey friends, im a begginner in vb.net, can i ask for idea how could i write this data inside the datable to a textfile,
example,
into a textfile looks like this
i try to use this code but i dont know how can use the writeline command to write vertical data into horizontal.
Thanks for help and more power.
example,
test1
test2
test3
test4
test5
test6
test7
test8
test9
test10
into a textfile looks like this
test1,test2,test3,test4,test5,
test6,test7,test8,test9,test10,
i try to use this code but i dont know how can use the writeline command to write vertical data into horizontal.
VB.NET:
Dim DT As DataTable
Dim strCommand As String = ""
Dim strBatchFile As String = ""
Dim Counter As Integer = 0
For Each objRow As DataRow In DT.Rows
Counter = Counter + 1
If strCommand = "" Then
strCommand = objRow!test
Else
strCommand = strCommand & ", " & objRow!test
End If
If Counter >= 5 Then
strBatchFile = strBatchFile & vbCrLf & strCommand
strCommand = ""
Counter = 0
End If
Next
Thanks for help and more power.