private void buttonStart_Click(object sender, System.EventArgs e)
        {
            buttonStart.Enabled = false;
            try
            {
                string filename    = textBoxInputFileName.Text.Trim();
                string outfilename = textBoxOutputFileName.Text.Trim();
                //extract settings
                tp.InputDatabase = DatabaseAdapterFactory.CreateReader(Path.GetExtension(filename), CheckBoxEditMode.Checked);

                tp.InputDatabase.FileName = filename;
                //transform settings
                tp.tableName          = comboBoxTableName.Text;
                tp.InputFieldNamesMap = TableProcessor.DeserializeFieldsMap(textBoxFieldsMapping.Text);

                //load settings

                //If Edit mode - copy original and open for wrtiting
                if (CheckBoxEditMode.Checked)
                {
                    tp.OutputDatabase = DatabaseAdapterFactory.CreateWriter(Path.GetExtension(outfilename));
                    tp.ProcessMode    = ProcessMode.pmEdit;
                }

                tp.OutputDatabase.FileName = outfilename;

                tp.Progress = new ProgressBarMonitor(toolStripProgressBar1, toolStripStatusLabel1, 100);

                int.TryParse(textBoxOffset.Text, out tp.ProcessOffset);

                tp.Process();

                string Msg = Path.GetFileName(tp.InputDatabase.FileName) + " processing complete";
                MessageBox.Show(this, Msg, "Results");
            }
            catch (Exception ex)
            {
                MessageBox.Show(this, ex.Message + " " + ex.StackTrace, "Error");
            }
            buttonStart.Enabled = true;
        }
        protected void Wizard1_FinishButtonClick(object sender, WizardNavigationEventArgs e)
        {
            Session["progress"] = new BaseProgress();
            SetMappings();
            //Start Processing
            TableProcessorNS.TableProcessor tp = new TableProcessorNS.TableProcessor();
            tp.Progress = (BaseProgress)Session["progress"];

            string inputFileName  = Session["InputFileName"].ToString().Trim();
            string outputFileName = Path.Combine(Path.GetDirectoryName(inputFileName), TextBoxOutputFileName.Text);

            tp.InputDatabase          = DatabaseAdapterFactory.CreateReader(Path.GetExtension(inputFileName), CheckBoxEditMode.Checked);
            tp.InputDatabase.FileName = inputFileName;
            tp.InputDatabase.Connect(inputFileName);
            List <string> tables = (List <string>)Session["tables"];

            tp.tableName = tables[0];
            List <string> modules = (List <string>)Session["Modules"];

            tp.SetRecordProcessor(Server.MapPath(Path.Combine("Modules", modules[0])));

            tp.InputFieldNamesMap = TableProcessor.DeserializeFieldsMap((string)Session["Mappings"]);



            //If Edit mode - copy original and open for wrtiting
            if (CheckBoxEditMode.Checked)
            {
                tp.OutputDatabase = DatabaseAdapterFactory.CreateWriter(Path.GetExtension(outputFileName));
                tp.ProcessMode    = ProcessMode.pmEdit;
            }

            tp.OutputDatabase.FileName = outputFileName;

            Thread run = new Thread(new ThreadStart(tp.Process));

            run.Start();
            Response.Write("Process started");
        }