I've an arraylist having 30000 items in it, what's the best way of creating a text file on the fly from an ASP.NEt page? Currently I'm using the code below but it times out with large data,
Using fileStr As New FileStream(sFileName, FileMode.Create, FileAccess.Write)
Using writer As New StreamWriter(fileStr)
writer.WriteLine("Error Messages")
For d As Integer = 0 To ar.Count - 1
writer.WriteLine(ar(d).ToString())
sErrMsg += "<tr><td class='errgrid'>><td class='errgrid'>" + ar(d).ToString() + "</td><tr>"
Next
writer.Close()
End Using
fileStr.Close()
End Using