public void ImportAllRows()
        {
            var ddlManager = new DDLManager();
            var bulkdInsertManager = new BulkInsertManager();
            String connString = GetConnectionString();
            Console.WriteLine("Start time" + DateTime.Now);

            ExcelStreamReader.Execute(fileName, reader =>

                reader.ForEachSheet(sheet =>
                {
                    var schema = sheet.GetSchema();

                    ddlManager.CreateTable(schema.TableName, schema, connString);
                    bulkdInsertManager.BulkInsertTo(schema, schema.TableName, sheet, connString);
                })
            );

            Console.WriteLine("End time" + DateTime.Now);
        }
示例#2
0
        public void ImportAllRows()
        {
            var    ddlManager         = new DDLManager();
            var    bulkdInsertManager = new BulkInsertManager();
            String connString         = GetConnectionString();

            Console.WriteLine("Start time" + DateTime.Now);

            ExcelStreamReader.Execute(fileName, reader =>

                                      reader.ForEachSheet(sheet =>
            {
                var schema = sheet.GetSchema();

                ddlManager.CreateTable(schema.TableName, schema, connString);
                bulkdInsertManager.BulkInsertTo(schema, schema.TableName, sheet, connString);
            })
                                      );

            Console.WriteLine("End time" + DateTime.Now);
        }
        static void Main(string[] args)
        {
            string fileName = @"C:\Users\pehe\Downloads\REPORT 73.xlsx";

            var ddlManager = new DDLManager();
            var bulkdInsertManager = new BulkInsertManager();
            String connString = GetConnectionString();
            Console.WriteLine("Start time" + DateTime.Now);

            ExcelStreamReader.Execute(fileName, reader =>

                reader.ForEachSheet(sheet =>
                {
                    var schema = sheet.GetSchema();

                    ddlManager.CreateTable(schema.TableName, schema, connString);
                    bulkdInsertManager.BulkInsertTo(schema, schema.TableName, sheet, connString);
                })
            );

            Console.WriteLine("End time" + DateTime.Now);
        }