By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,333 Members | 1,022 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,333 IT Pros & Developers. It's quick & easy.

How to Transfer an Excel Range to an ADO.Net DataSet or DataTable in VB.Net?

P: n/a
Hey All,

I've seen lots of stuff regarding pumping data into Excel from .Net but
haven't found anything for the reverse.

Does anyone have a snippet, article ID, etc. demonstrating how to take a
range object and pump that data into an ADO.Net DataSet?

Thanks,

TC
Nov 2 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
You handle this the same way you handle other data sources. First get
your connection string from www.connectionstrings.com and then proceed
to use ADO.NET to connect and read from the excel file.

Thanks,

Seth Rowe
TCook wrote:
Hey All,

I've seen lots of stuff regarding pumping data into Excel from .Net but
haven't found anything for the reverse.

Does anyone have a snippet, article ID, etc. demonstrating how to take a
range object and pump that data into an ADO.Net DataSet?

Thanks,

TC
Nov 2 '06 #2

P: n/a
On Thu, 2 Nov 2006 00:29:45 -0500, "TCook" <ge**********@yahoo.comwrote:

Hey All,

I've seen lots of stuff regarding pumping data into Excel from .Net but
haven't found anything for the reverse.

Does anyone have a snippet, article ID, etc. demonstrating how to take a
range object and pump that data into an ADO.Net DataSet?

See the following MS KB article:

How To Use ADO.NET to Retrieve and Modify Records in an Excel Workbook With Visual Basic .NET
http://support.microsoft.com/kb/316934
Paul
~~~~
Microsoft MVP (Visual Basic)
Nov 2 '06 #3

P: n/a
Hey Guys,

I don't think that I was quite clear.

Using a range object, is there a quick way to blast the data into a
datatable?

For example, using a range object, one can dump the data to an array. Is
there a way to do something similar with a range object and a datatable?

Is there a quick way to dump the data from an array into a datatable?

I won't be using connection strings, etc. I will be using range objects.

Thanks & Regards,

TC
"Paul Clement" <Us***********************@swspectrum.comwrote in message
news:5i********************************@4ax.com...
On Thu, 2 Nov 2006 00:29:45 -0500, "TCook" <ge**********@yahoo.comwrote:

Hey All,

I've seen lots of stuff regarding pumping data into Excel from .Net but
haven't found anything for the reverse.

Does anyone have a snippet, article ID, etc. demonstrating how to take a
range object and pump that data into an ADO.Net DataSet?

See the following MS KB article:

How To Use ADO.NET to Retrieve and Modify Records in an Excel Workbook
With Visual Basic .NET
http://support.microsoft.com/kb/316934
Paul
~~~~
Microsoft MVP (Visual Basic)

Nov 2 '06 #4

P: n/a
Hi TCook,
For example, using a range object, one can dump the data to an array. Is
there a way to do something similar with a range object and a datatable?
Not a .NET datatable, no. Excel (like most "traditional" Office apps) is
blissfully ignorent of all things .NET. Putting the range data into an
array, then that into the data table is probably your fastest choice if you
can't use a connection.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)

Nov 3 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.