PC Review


Reply
Thread Tools Rate Thread

Any quicker way to write data from DataTable to Excel?

 
 
musa.biralo
Guest
Posts: n/a
 
      18th Jun 2009
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 With Quote
 
 
 
 
Patrick Molloy
Guest
Posts: n/a
 
      18th Jun 2009
does the dataTable come from a recordset? if so, you could use the Excel
Range's CopyFromRecordset method

"musa.biralo" <(E-Mail Removed)> wrote in message
news:adecf8db-33ef-4e18-92a3-(E-Mail Removed)...
> 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 With Quote
 
musa.biralo
Guest
Posts: n/a
 
      18th Jun 2009
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" <patrick_mol...@hotmail.com>
wrote:
> does the dataTable come from a recordset? if so, you could use the Excel
> Range's CopyFromRecordset method
>
> "musa.biralo" <musa.bir...@gmail.com> wrote in message
>
> news:adecf8db-33ef-4e18-92a3-(E-Mail Removed)...
>
> > 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 With Quote
 
Patrick Molloy
Guest
Posts: n/a
 
      18th Jun 2009
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" <(E-Mail Removed)> wrote in message
news:af9855fc-049c-44d6-b4d3-(E-Mail Removed)...
> 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" <patrick_mol...@hotmail.com>
> wrote:
>> does the dataTable come from a recordset? if so, you could use the Excel
>> Range's CopyFromRecordset method
>>
>> "musa.biralo" <musa.bir...@gmail.com> wrote in message
>>
>> news:adecf8db-33ef-4e18-92a3-(E-Mail Removed)...
>>
>> > 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Write Macro to Fix Data Alignment (Data dump from Crystal to Excel Karin Microsoft Excel Misc 2 22nd Sep 2009 05:31 PM
Retrieving Data from Excel Pivot tables into Datatable =?Utf-8?B?Q2hlbHZ5?= Microsoft Excel Programming 0 8th Jul 2006 12:10 AM
Excel should calculate sums quicker in status bar =?Utf-8?B?UGhpbCBL?= Microsoft Excel Misc 1 3rd Jun 2006 08:10 PM
How convert Excel data into DataSet/DataTable? Ronald S. Cook Microsoft C# .NET 2 14th Feb 2006 09:30 PM
Quicker way to process data with single quotes during INSERT Jason Microsoft Access Queries 3 11th Aug 2004 06:52 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:49 AM.