Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / November 2006

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
TCook - 02 Nov 2006 06:29 GMT
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
rowe_newsgroups - 02 Nov 2006 12:49 GMT
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

> Hey All,
>
[quoted text clipped - 7 lines]
>
> TC
Paul Clement - 02 Nov 2006 15:53 GMT
¤ 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)
TCook - 02 Nov 2006 18:52 GMT
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

> ¤ Hey All,
> ¤
[quoted text clipped - 13 lines]
> ~~~~
> Microsoft MVP (Visual Basic)
Cindy M. - 03 Nov 2006 13:28 GMT
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 :-)

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.