Wrox Programmer Forums
|
ASP.NET 1.x and 2.0 Application Design Application design with ASP.NET 1.0, 1.1, and 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.x and 2.0 Application Design section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 12th, 2007, 02:04 AM
Authorized User
 
Join Date: Oct 2003
Posts: 89
Thanks: 0
Thanked 0 Times in 0 Posts
Default export excel files

Hi,

I have a .net winforms application that exports excel files into the database. I have to modify the code so that the files are loaded in a specific order according to their file names.
The format of the file name is as follows: date_name.xls. The date part changes but not the name.
I have to first load for example 080807_Venues.xls followed by 080807_Seminar.xls and then 080807_Employees.xls etc.

How do i tell the code the order by which to load the files?

Thanks for the help

 
Old August 13th, 2007, 06:04 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

How are you selecting what files to deal with? Is the user selecting these files? Is the program picking them up automatically from somewhere?

I noticed that the list you provided is in descending alphanumeric order. Is this relevant or coincidence?

-Peter
 
Old January 3rd, 2008, 09:09 AM
Authorized User
 
Join Date: Jul 2007
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to mujahidkhaleel
Default

You can probably try

string[] names = new string[] {"Venues", "Seminar", "Employees"};

foreach(string name in names)
{
    FileInfo[] xlfiles = dir.GetFiles("*" + name + ".xls");
    //Your file processing code here
}

Mujahid Khaleel
Web designing, development, E-commerce applications.





Similar Threads
Thread Thread Starter Forum Replies Last Post
CSV files export with Classic ASP, special chars tn_bobbie Classic ASP Basics 1 July 9th, 2015 08:12 AM
Generating Excel FIles from resource Files abinashpatra ASP.NET 1.0 and 1.1 Basics 0 July 28th, 2008 02:07 AM
Export to multiple Excel files using template ecapox Access VBA 0 February 5th, 2008 10:38 AM
Merge many excel files into one excel files Roshanjoshi2001 Excel VBA 2 November 14th, 2007 06:23 PM
Export to Many files using VB6 and CR8.5 PauloMongo Crystal Reports 1 October 28th, 2003 04:39 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.