Solved

c#  Reading WorkSheets from Excel File

Posted on 2008-06-21
2
389 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
ID: 21841067
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
ID: 22058893
Hi there,

Why not just reverse the order in your list?

list.Reverse();

That should do it.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

815 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

12 Experts available now in Live!

Get 1:1 Help Now