示例#1
0
        private void ReadArtists()
        {
            ArtistReader2 artistReader = new ArtistReader2(this.config.ArtistsXmlPath);

            foreach (Artist artist in artistReader.Enumerate())
            {
                this.progressReporter.Report("Artists", artistReader.EstimatedProgress);
            }
            this.progressReporter.Report("Artists", -1);
        }
示例#2
0
        private void ImportArtists()
        {
            this.helper.SelectDatabase();

            ArtistReader2  artistReader   = new ArtistReader2(this.config.ArtistsXmlPath);
            ArtistInserter artistInserter = new ArtistInserter(this.config.Conn);

            foreach (Artist artist in artistReader.Enumerate())
            {
                try
                {
                    artistInserter.Insert(artist);
                }
                catch (MySqlException ex)
                {
                    Console.WriteLine("Error importing artist " + artist.Id + ": " + ex.Message);
                }

                this.progressReporter.Report("Artists", artistReader.EstimatedProgress);
            }
            this.progressReporter.Report("Artists", -1);
        }