• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 396
  • Last Modified:

c# Reading WorkSheets from Excel File

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
dotnet0824
Asked:
dotnet0824
1 Solution
 
vbturboCommented:
Try paste the code on how you access and read the excell file

vbturbo
0
 
WendellUrthCommented:
Hi there,

Why not just reverse the order in your list?

list.Reverse();

That should do it.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now