Clean the data first by loading the data into an arraylist and removing
duplicates. Someone else posted this code in another group - but it should
do the job nicely.
public static ArrayList RemoveDuplicates(ArrayList list) {
ArrayList ret=new ArrayList();
foreach (object obj in list) {
if (!ret.Contains(obj)) ret.Add(obj);
}
return ret;
}
--
Regards
John Timney
ASP.NET MVP
Microsoft Regional Director
The typical approach is to either filter out the messy data with some
custom code that does the import, or create a staging area. A staging
area is a table or set of tables where you can upload the data and
then cleanse it. Remove duplicates, trim strings, etc. A staging area
would not have the same referential integrity constraints as the
production area, so it will allow duplicates and give you a place to
clean the data up.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.