views:

21

answers:

1

Howdy, Now I'm a complete newby to .Net and the likes of VB (I'm more of a Ruby/Rails, PHP kinda guy).

Anyway I currently have a sub that has a string builder that I'm wish to use as the content of a CSV which I will email later from a webpage. My stringbuilder is creating the content for the CSV but I don't know how to create the CSV dynamically (I don't want the CSV on disk).

  Private Shared Sub BuildClientTrustBalanceCSV(ByVal sb As StringBuilder, ByVal clientsWithTrustBalance As List(Of NonPaymentHistory))

    If clientsWithTrustBalance Is Nothing OrElse clientsWithTrustBalance.Count = 0 Then
      Exit Sub
    End If

    ' need to somewhere create the CSV then inject the StringBuilder into it?

    With sb

      ' create the CSV
      For Each zeroBalanceClient As NonPaymentHistory In clientsWithTrustBalance
        .AppendFormatLine("{0},", zeroBalanceClient.Number)
      Next zeroBalanceClient

    End With


  End Sub

Any ideas? I know I should be able to sort this but .NET just isn't my thing?

A: 

Here is a link that might be helpful, but I agree with Oded that the question is misleading.

http://stackoverflow.com/questions/44194/how-do-i-best-generate-a-csv-comma-delimited-text-file-for-download-with-asp-ne

Wade73
Sorry if I mislead you guys, thanks for both your help
Mike Sav