title: export to excel from vb.net from sql datareader
body: <p>I have an sql query with sql datareader. i put a for loop for the data reader. now when the data starts coming in from the query i want it to export to excel in the for loop.
  here's my code</p>
  
  <p>Try
              Dim SqlStr As String = "", dr As SqlDataReader = Nothing</p>
  
  <pre><code>        ConnectDB(Cnn)
          Str = "query"
          SqlCmd = New SqlCommand(Str, Cnn)
          dr = SqlCmd.ExecuteReader
  
  while dr.read
  ..EXPORT TO EXCEL
  do
  end while
  </code></pre>
  
  <p>does anyone know how to do this?</p>