Hi,
I am trying to right a script ( Very new to Scripting ) that will query a SQL database, Return a certain number of rows and then right them to an output file, In this case CSV.
I can do this for a single entry without any problems, what i am having trouble with is trying to loop through all the rows, and then writing all the rows to the csv.
what i have written so far is as follows :-
Dim csvWriter As New System.IO.StreamWriter("c:\test.csv",true)
Dim dataRow As String
Dim csvData As New StringBuilder
Dim Result() As String
Result = me.GetTokenValue("ForEachRow_Iteration")
Dim InterationValue As String
InterationValue = me.GetTokenValue("Token_Iteration")
Dim Result() As String
Result = me.GetTokenValue("ForEachRow_Iteration")
Dim InterationValue As String
InterationValue = me.GetTokenValue("Token_Iteration") ----- Token assigned in workflow from each row
For Each InterationValue in Result
dataRow = me.TokenReplace( "%(Token_Date),%(Token_ID),%(Token_TYPE),%(Token_Document), %(Token_Category)") ---- tokens assigned from each entry
csvData.AppendLine(dataRow)
Next
Can Anyone See what i am doing wrong?
Hope someone can help
Regards
Mark