?
Solved

Data Discovery

Posted on 2006-05-03
3
Medium Priority
?
166 Views
Last Modified: 2010-04-23
Hello,

I have an excel spreadsheet I want to import into vb.net to display in a list view. Now i am currently importing it into a data set however I am coming accross and issue with this. I need a way to discover the names of the individual sheets in this workbook in order to properly import it. can anyone help me with this? also, is a list view the best way to display this data?

Thanks!
0
Comment
Question by:loureiro
1 Comment
 
LVL 17

Accepted Solution

by:
ZeonFlash earned 1000 total points
ID: 16597442
If you are using an OLE connection, you can get the names of the sheets into a data table.  You can traverse through the data table at that point, looking in the Table_Column column for the names.

Dim dbcon As New OleDbConnection
Dim dtTable As DataTable = dbcon.GetOleDbSchemaTable(Data.OleDb.OleDbSchemaGuid.Tables, New Object() {Nothing, Nothing, Nothing, "TABLE"})

For Each row As DataRow In dtTable.Rows
    '...etc etc
Next
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses
Course of the Month14 days, 17 hours left to enroll

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question