Hi Matt,
We used the OLEDB provider and SQL statements in the web server to export
data to Excel. Here is a sample.
' Opening connections to Excel file.
''connString = "Provider=Micro soft.Jet.OLEDB. 4.0;Data
Source=C:\Book1 .xls;Extended Properties=""Ex cel 8.0;HDR=NO;"";"
cnn = New OleDbConnection (connString)
cnn.Open()
Dim cmd As New OleDbCommand
cmd.Connection = cnn
' Reading the number of rows that are present in the data tab
where the population will occur.
cmd.CommandText = QUERY_EXCEL_ROW _COUNT
Dim rdr As OleDbDataReader = cmd.ExecuteRead er
Dim rowCount As Integer = 1
While rdr.Read()
rowCount += 1
End While
rdr.Close()
' Reading fields values from Excel template.
cmd.CommandText = QUERY_EXCEL_TEM PLATE_FIELDS
rdr = cmd.ExecuteRead er
rdr.Read()
Dim index As Integer
For index = 0 To rdr.FieldCount - 1
fieldsNames.Add (rdr.GetString( index))
Next
rdr.Close()
Mike
"Matt Bailey" <ba*********@gm ail.comwrote in message
news:11******** **************@ h48g2000cwc.goo glegroups.com.. .
Good afternoon,
I have an asp.net project wherein I am trying to export data into
excel. I have that working, however, I am typically dealing with a
large volume of data when I do this. Can anyone suggest a better
method for this job other than reading the data into a datagrid and
then rendering the datagrid as an excel spreadsheet?
Any and all help is greatly appreciated.
Thanks