示例#1
0
        /** Creates list of Mapping class which contains mapping between columns
         *  (source and target)
         * TODO :
         *  1. Decide what gonna be source and target.
         */
        protected IEnumerable<Mapping> ExtractColumnMappings(Table table)
        {
            var columnMappings = new List<Mapping>();
            foreach (var column in table.Columns)
            {
                if (column.IsForImport)
                {
                    columnMappings.Add(
                        new Mapping(column.Name, column.MappingColumnName));
                }
            }

            return columnMappings;
        }
示例#2
0
 public DataTable GetData(Table table)
 {
     throw new NotImplementedException();
 }
示例#3
0
        /* use for source select command (need for IDataReader instance creation) */
        protected string ConstructSelectCommand(Table table)
        {
            StringBuilder commnadTextBuilder = new StringBuilder("SELECT ");

            foreach (var column in table.Columns)
            {
                if (column.IsForImport)
                    commnadTextBuilder.AppendFormat("{0},", column.Name);
            }

            // removes last ',' sign
            commnadTextBuilder.Remove(commnadTextBuilder.Length - 1, 1);

            commnadTextBuilder.AppendFormat(" FROM dbo.[{0}]", table.Name);

            return commnadTextBuilder.ToString();
        }