title: Can anyone convert this VB.NET code to VBScript?
body: <p>Anybody out there that can help convert this small chunk of VB.NET to VBScript, I didn't realise when I was writing my tester app that the application I was going to use it in is all VBScript =(</p>
  
  <p>The code gets a table from the database, then writes a couple of lines and then the table to a tab delimited file. I understand I may have to rewrite the part with Lambda completely? I may have to start again but if anyone can do this I would be appreciative!</p>
  
  <pre><code>Private dataTable As New DataTable()
  
  Protected Sub Page_Load(sender As Object, e As EventArgs)
  PullData()
  End Sub
  
  Public Sub PullData()
  'Get data from DB into a DataTable
  Using conn As New SqlConnection("Server=.\sqlexpress;Database=DB;User Id=User;Password=Password;")
      Using cmd As New SqlCommand("SELECT areaID as 'Pond Number', storageDescription + SPACE(1) + areaID as 'Pond Name', " &amp; vbCr &amp; vbLf &amp; "case when fishWeight = 0 then 0 else 1 end as 'Pondis Used', 1 as 'Volume', " &amp; vbCr &amp; vbLf &amp; "FeedDensity AS 'Feed Density',round(cast(FeedDensity * revolution as float(25)),2)/*cast as float for correct rounding*/ AS 'Feed Multiplier'," &amp; vbCr &amp; vbLf &amp; "feedType as 'Feed Type', feedName as 'Feed Name', batchID AS 'FishBatchCode'" &amp; vbCr &amp; vbLf &amp; vbCr &amp; vbLf &amp; "FROM dbo.vwStorageMASTER" &amp; vbCr &amp; vbLf &amp; vbCr &amp; vbLf &amp; "WHERE fkLocationID = 1 AND fkStorageIndicator &lt;&gt; 3  ORDER BY sequenceNumber ASC", conn)
          conn.Open()
  
          Dim da As New SqlDataAdapter(cmd)
          da.Fill(dataTable)
      End Using
  End Using
  
  'Output tab-delimited
  Dim delim As String = vbTab
  Dim sb = New StringBuilder()
  
  sb.AppendLine("Trafalgar Master File" &amp; vbCr &amp; vbLf &amp; vbCr &amp; vbLf)
  sb.AppendLine(String.Join(delim, "Number of Ponds: ", dataTable.Rows.Count.ToString() &amp; vbCr &amp; vbLf &amp; vbCr &amp; vbLf))
  
  sb.AppendLine(String.Join(delim, dataTable.Columns.Cast(Of DataColumn)().[Select](Function(arg) arg.ColumnName)))
  For Each dataRow As DataRow In dataTable.Rows
      sb.AppendLine(String.Join(delim, dataRow.ItemArray.[Select](Function(arg) arg.ToString())))
  Next
  
  'Prompt user to download tab-delimited file
  Dim FileName As String = "test.xls"
  Dim response As System.Web.HttpResponse = System.Web.HttpContext.Current.Response
  response.ClearContent()
  response.Clear()
  response.ContentType = "text/plain"
  response.AddHeader("Content-Disposition", "attachment; filename=" &amp; FileName &amp; ";")
  response.Write(sb.ToString())
  response.Flush()
  response.[End]()
  End Sub
  </code></pre>