Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 55
Default Any quicker way to write data from DataTable to Excel?

Hello Group!

I have a DataTable as below and currently I am writing this to excel
by looping through each column and then each row. I am wondering if
there is a quicker way to dump all the data once or any time smart
method to save data writing process.

col1 col 2 col3
A B C
D E F

I am playing with VB.NET
Thanks a lot!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default Any quicker way to write data from DataTable to Excel?

does the dataTable come from a recordset? if so, you could use the Excel
Range's CopyFromRecordset method

"musa.biralo" wrote in message
...
Hello Group!

I have a DataTable as below and currently I am writing this to excel
by looping through each column and then each row. I am wondering if
there is a quicker way to dump all the data once or any time smart
method to save data writing process.

col1 col 2 col3
A B C
D E F

I am playing with VB.NET
Thanks a lot!


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 55
Default Any quicker way to write data from DataTable to Excel?

Thank You Patrick.
The DataTable is created from DataSet.
Do you have any snippet or any web-link that I can follow?

Thanks for your time.

Musa.Biralo

On Jun 18, 10:55*am, "Patrick Molloy"
wrote:
does the dataTable come from a recordset? if so, you could use the Excel
Range's CopyFromRecordset method

"musa.biralo" wrote in message

...

Hello Group!


I have a DataTable as below and currently I am writing this to excel
by looping through each column and then each row. I am wondering if
there is a quicker way to dump all the data once or any time smart
method to save data writing process.


col1 *col 2 col3
A * * * B * * * *C
D * * * E * * * *F


I am playing with VB.NET
Thanks a lot!




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default Any quicker way to write data from DataTable to Excel?

alas no ... the last time i had to do this i iterated through the DataTable
(C#)
However, you probably already have the sql, so you could maybe use a
DataReader instead - I've found that to be quicker

"musa.biralo" wrote in message
...
Thank You Patrick.
The DataTable is created from DataSet.
Do you have any snippet or any web-link that I can follow?

Thanks for your time.

Musa.Biralo

On Jun 18, 10:55 am, "Patrick Molloy"
wrote:
does the dataTable come from a recordset? if so, you could use the Excel
Range's CopyFromRecordset method

"musa.biralo" wrote in message

...

Hello Group!


I have a DataTable as below and currently I am writing this to excel
by looping through each column and then each row. I am wondering if
there is a quicker way to dump all the data once or any time smart
method to save data writing process.


col1 col 2 col3
A B C
D E F


I am playing with VB.NET
Thanks a lot!




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Block copy of Datatable to Excel Spreadsheet using C# Peter S. Excel Programming 10 October 31st 07 12:50 PM
How to Transfer an Excel Range to an ADO.Net DataSet or DataTable in VB.Net? TCook Excel Programming 4 November 3rd 06 12:28 PM
Retrieving Data from Excel Pivot tables into Datatable Chelvy Excel Programming 0 July 8th 06 12:10 AM
Bind datatable to excel worksheet gianni Excel Programming 0 April 28th 05 02:54 PM
Excel into DataTable using OleDbDataAdapter Matthew_H Excel Programming 1 March 4th 05 08:25 AM


All times are GMT +1. The time now is 04:29 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"