473,396 Members | 1,772 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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

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
4 2996
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Paul | last post by:
Hi all Arggghhh........... The problem.....I want the user to be able to create an excel document and name particular cells in the document where they want the data to be placed and then save...
0
by: acharyaks | last post by:
Hi life saver, I am using excel component for the development. The purpose is to connect to excel through the odbc connection string. Then through the connection extract data into a dataset and...
8
by: DC Gringo | last post by:
I have a simple button that should open another window and export a datagrid to an Excel file. I'm getting: "Name 'window' is not declared." What do I need to declare or import? <INPUT...
3
by: DC Gringo | last post by:
Allison (or others), thank you for the advice...a few more questions: - I have tested on my workstation on Excel XP and my application references the Excel 10.0 Object Library. I was told the...
4
by: Staticbob | last post by:
Guys, I have this code that loads some data from a SQL view into a datatable, then into arrays, I can then export it to a predefined Excel template that creates lots of fancy charts and stuff...
12
by: Ed | last post by:
Hi All, I'm looking for an efficient way of dumping a table in a Dataset into an Excel sheet. I'm currently copying data cell by cell and this is rather inefficient for large Datasets. My...
3
by: | last post by:
I wrote a class in VB.NET to export the contents of a datagrid to Excel. It works perfectly on my machine, but it fails on my customers' PCs that have identical versions of Win XP (SP1) and Excel...
9
by: dba123 | last post by:
I need some help and direction on what classes and an example or two (article) on how to read an Excel Worksheet and insert one column into a database table column. I am using .NET 2.0 only. What...
1
by: DennisBetten | last post by:
First of all, I need to give some credit to Mahesh Chand for providing me with an excellent basis to export data to excel. What does this code do: As the title says, this code is capable of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.