Hello, I am trying to export the results of a SQL server 2000 stored procedure from my VB.NET application. So far, I am able to export it with a tab or comma delimiter, but I need to export it as a fixed column witdh text file.
I first populate a datatable with the stored procedure results and then I loop through each record and generate the file like this:
With ExportDataSet.Tables(0) ' Exporting the records
' write out each data row
For Each row As DataRow In ExportDataSet.Tables(0).Ro
ws
'Set the delimiter to an empty string (beggining of the line)
delim = ""
For Each value As Object In row.ItemArray
output.Write(delim)
output.Write(value)
'Change the delimiter to a tab
delim = ControlChars.Tab
Next
' write the row
output.WriteLine()
Next
End With
Does anyone have an example on how to accomplish this with a fixed column witdh export?
Thanks!
Start Free Trial