export to excel from vb.net from sql datareader
- by reffer
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
Try
Dim SqlStr As String = "", dr As SqlDataReader = Nothing
ConnectDB(Cnn)
Str = "query"
SqlCmd = New SqlCommand(Str, Cnn)
dr = SqlCmd.ExecuteReader
while dr.read
..EXPORT TO EXCEL
do
end while
does anyone know how to do this?