Converting Excel to XML: A mapped element's relationship with other elements cannot be preserved

A client of mine provided me an excel spreadsheet of a list of wines to be placed on a website. I decided the best way to do so was to export the list into an xml file, then use it as a datasource for a .net gridview. The concept seemed simple enough.

However, when trying to convert from excel to xml, I received the following error message: "A mapped element's relationship with other elements cannot be preserved". So I did was most developers do, which is to check the xsd file for issues, researched the web for solutions, etc. But I found nothing that resolved my issue.

To make a long story short, what I found was that, although the list of wines contained 490 rows, excel was only detecting a subset of rows for certain columns. So for example, excel correctly identified 490 rows for each of my first 3 columns, but for whatever reason, even though the remaining 3 columns contained 490 rows of data, the xml mapping was only detecting 5 rows. So excel was complaining because the mapping (for whatever reason) could not see all 490 rows for all 6 columns.

To make this long story even shorter, I didn't know how my client created (and/or messed up) the spreadsheet, nor did I care. What I decided to do was to save the entire workbook into a new comma-delimited text file (csv file). I then opened the newly saved csv file in excel, and was able to successfully map and export the data into xml.

Webhosting - Webhost4Life

I have used a number of webhosts in the past 15 years - I have used discountasp.net, hostmysite.com, webhost4life, m6.net, godaddy.com, and a handful of others that I cannot recall at this time. There are a number of considerations when selecting a webhost, which I will not go into here, because that is not the point of my post.

The point here is that if you are thinking of going with webhost4life, I advise that you seriously reconsider! STEER CLEAR OF WEBHOST4LIFE! You will save yourself unnecessary agony and stress. The main reason is their absolutely poor support; the worst I've seen by far. Their website is nice, professional-looking with a "live customer support" chat feature. However, the chat directs you to a tier 1 customer support person that really cannot do anything but verify that your issue "exists". From there, it needs to go to a technician who may take a couple of days to resolve the issue.

Here are just some of the issues I experienced within a year of being with webhost4life.com:

I have run into issues where they migrated databases from a legacy server to a new platform without notifying me. It was only when I encountered a problem (ie database down), that I find out that my database had been migrated to a new platform months ago, and I should have been using the new platform... even if they never provided me with connectivity/credentials to the new platform! On top of that, they ignorantly suggested that I immediately point my website to the new platform database, even though the database is stale, containing old data from a couple of months back! At that point I ask them to re-migrate the data, which is like pulling teeth! They absolutely refuse to re-migrate data telling me that it takes too long. I keep insisting they need to re-migrate data. Again, it is like pulling teeth, so I finally get them to execute a full backup, after which I take my data to a new webhost.

I have requested database backups, and after waiting a week, received a sql script of my database - not the database backup! Thus, I had to re-request the backup, which I needed to wait an additional week for.

Consider the fact that they also have an option for "premium support" in which you can get faster access to a technician.. for $24.95/month. Of course, you won't see this until you actually subscribe to their service, and even then you won't see it until you open a ticket. Based on my prior experience with their customer service, I'm almost always tempted to purchase the premium support, but whose to say it would be better? Besides, if they are guaranteeing typical uptime, if my database is down, they should get someone on it ASAP, regardless if I have premium support or not! Unbelievable!

There are many more issues, that I don't (and don't care to) recall. Trust me, do yourself a favor and stay away from webhost4life.com! Ugh! I'm getting flashbacks just thinking about them...

Storing Photos in a Database vs Storing Photos in a File System

One of the more common questions in terms of photo storage for web-based applications is whether to store photos in a database or in a folder on the website. Most discussions on this topic focuses on pros/cons in terms of ease of photo access, data integrity, and backups/recoverability.

In most discussions, it is not that clear cut. There are definitely pros and cons to each, and it is sometimes difficult to determine which method will work best in the long run. However, there is one additional factor that is seldom discussed, and is probably more applicable in a hosted environment, and that factor is hard drive space. Typically, in a hosted environment, your website will have much more space than the space allotted to you on your hosted database server. In that case, you are probably better off placing your photos in a folder, on your website, and access it that way. Otherwise, you run the risk of running out of precious database space.

If space is not an issue, I prefer storing my photos in the database for ease of backups/recovery, and data integrity. However, in a hosted environment where SQL space is limited, I would definitely lean towards storing it on the website.

A little about the IT Bad Ass

Yes, I'm in Information Technology - What's it to you?! Just kidding. Yes, I'm in, and have been in, IT for over 16 years now, but I'm definitely no bad ass. As you all know, it's a ever-changing and rapidly evolving field, and frankly, no one can claim to know it all. And neither will I. IT Bad Ass just seemed like a cool name to use, so don't take it literally. And don't worry, I won't kick your ass either.

My expertise is in software development, database design, and database administration. I have developed solutions for a variety of industries, including the telecommunications industry, the real estate industry, and insurance industry, to name a few. I have developed midrange applications, desktop applications, websites, and ecommerce sites, and online games. I have been responsible for multi-million dollar projects, as well as major application redesigns and database migrations.

I have planned to create a blog to share small bits of information for over a couple of years now, but never got around to it. As of 8/13/2010 (today), I have decided to do so, with this being my innaugural post. We'll see how long this continues!