void FillMapFields()
        {
            string filename = Session["InputFileName"].ToString();
            //input fields
            IDatabaseAdapter inputDatabase = DatabaseAdapterFactory.CreateReader(Path.GetExtension(filename), CheckBoxEditMode.Checked);
            List <string>    tables        = (List <string>)Session["tables"];

            inputDatabase.Connect(filename);
            Dictionary <string, int> fields = inputDatabase.GetFields(tables[0]);

            //target fields
            TableProcessorNS.TableProcessor tp = new TableProcessorNS.TableProcessor();
            List <string> modules           = (List <string>)Session["Modules"];
            var           processorFileName = Server.MapPath(Path.Combine("Modules", modules[0]));

            tp.SetRecordProcessor(processorFileName);

            Dictionary <Field, bool> transformFields = tp.GetTransformFields();

            DataTable transformFieldsTable = new DataTable();

            transformFieldsTable = new DataTable();
            transformFieldsTable.Columns.Add("targetField");
            transformFieldsTable.Columns.Add("inputField");
            transformFieldsTable.Columns["targetField"].ReadOnly = true;

            foreach (KeyValuePair <Field, bool> row in transformFields)
            {
                transformFieldsTable.Rows.Add(row.Key.Name, "");
            }

            Repeater1.DataSource = transformFieldsTable;
            Repeater1.DataBind();
        }
        protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            switch (e.Item.ItemType)
            {
            case ListItemType.Item:
            case ListItemType.AlternatingItem:
            {
                // Find secondary DDL
                DropDownList DropDownList2 = e.Item.FindControl("DropDownList2") as DropDownList;
                if (DropDownList2 != null)
                {
                    string filename = Session["InputFileName"].ToString();
                    //input fields
                    IDatabaseAdapter inputDatabase = DatabaseAdapterFactory.CreateReader(Path.GetExtension(filename), CheckBoxEditMode.Checked);
                    List <string>    tables        = (List <string>)Session["tables"];

                    inputDatabase.Connect(Session["InputFileName"].ToString());
                    Dictionary <string, int> fields = inputDatabase.GetFields(tables[0]);

                    DropDownList2.Items.Clear();
                    DropDownList2.Items.Add("");
                    foreach (KeyValuePair <string, int> row in fields)
                    {
                        var item = new ListItem(row.Key);
                        //Set field if it present in input document
                        DropDownList2.Items.Add(item);
                    }
                }
                break;
            }
            }
        }
        void MapFields(IRecordProcessor rp)
        {
            Dictionary <string, int> inputFields = inputDatabase.GetFields(tableName);
            Dictionary <string, int> fieldsMap   = new Dictionary <string, int>();

            foreach (KeyValuePair <string, string> fieldpair in inputFieldNamesMap)
            {
                string transferColName = fieldpair.Value;
                if (fieldpair.Key.Length > 0)
                {
                    int fieldIndex = inputFields[fieldpair.Key];
                    fieldsMap[transferColName] = fieldIndex;
                }
            }
            rp.setFieldsMap(fieldsMap);
        }