Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

c#  Reading WorkSheets from Excel File

Posted on 2008-06-21
2
Medium Priority
?
394 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 1000 total points
ID: 22058893
Hi there,

Why not just reverse the order in your list?

list.Reverse();

That should do it.
0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

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

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

715 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