Solved

c#  Reading WorkSheets from Excel File

Posted on 2008-06-21
2
386 Views
Last Modified: 2013-12-16
Hi,
I have an Excel file with 3 work sheets namely (Order of Tabs is)  1)ZR  2)JIMP 3) STON
When I read them the Order is not accordingly .. The array is populated like  list(0) = STON
                                                                                                                         list(1) = JIMP
                                                                                                                         list(2) = ZR
I dont want it like this.. It should be in the order of the Tabs  in the Exel Sheet.
Here is the code
dataTable tables = connection.GetSchema("Tables");
                          List<string> list = new List<string>();
                       foreach (DataRow row in tables.Rows)
                            list.Add(row["TABLE_NAME"].ToString());
                      return list;
0
Comment
Question by:dotnet0824
2 Comments
 
LVL 18

Expert Comment

by:vbturbo
Comment Utility
Try paste the code on how you access and read the excell file

vbturbo
0
 
LVL 1

Accepted Solution

by:
WendellUrth earned 250 total points
Comment Utility
Hi there,

Why not just reverse the order in your list?

list.Reverse();

That should do it.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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 …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now