views:

213

answers:

3

Once in a while, we use .XLS file to convert the data stored in the XML file and populate some dropdownlist and other server controls using XmlDataSource object. I am just wondering how popular is the use of the.XLS file in the .Net proejcts? We have used to populate countries list and state list and other huge amount of the project specific lists.

+1  A: 

Well, Excel (XLS) is very popular with a lot of management and project planning folks - hardcore developer will probably prefer the straight XML.

XLS is ok - but it's a bit messy to deal with and to create and read (before the Excel 2007 XLSX xml-based format).

So - if you're exchanging data and/or keeping track of data to display in a drop down list - use a proper database table, or if that's not possible, I'd recommend XML over Excel (XSL).

Cheers, Marc

marc_s
I'm tasked to do a project right along these lines. The customer has an XLS file with about 100 providers they want the public to be able to search for. I'm going to write tool to let the customer upload their XLS file and then the app will suck that into an XML file for storage.
Dillie-O
A: 

using gui based COM interop with applications server-side is a collosal no-no. Either cache/persist the data from xml in memory, or put it into a database.

I am focusing on your mention of server-control. if you are using .Net 3.5, use a Linq-to-XML query against the xml source, and put the result into asp.net cache, with a cache dependency on the original xml, this is your best bet. If it's key/value pairs for a listbox, this is what Dictionary was made for.

Excel can be a nice shortcut for a lot of automation tasks, but a server-side and presumably web context is a particularly bad fit. Especially for storing processed XML.

Tracker1
A: 

I have found XLST (I'm assuming that's what you're talking about) to come in quite handy in my own personal experience for .NET development tied in with XML and HTML. It has some definite quirks that I don't particularly care for, but all in all, I've found it to be worthy enough to warrant its use.

Joe Morgan
Exactly that is what I mean.
Shiva