Пример #1
0
        //public static FiasOperatorXML fiasXMLDataSetConverter = new FiasOperatorXML(new DirectoryInfo(XML_Directory), connection, schemaname);


        static void Main(string[] args)
        {
            try
            {
                var ct = new CancellationTokenSource();
                SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder()
                {
                    DataSource         = "BUSHMAKIN",
                    InitialCatalog     = "UNS",
                    IntegratedSecurity = true,
                    ConnectTimeout     = 0,
                    NetworkLibrary     = "dbmssocn"
                };
                var             serverTableType         = ServerTableType.GlobalTemp;
                FiasOperatorDBF fiasDBFDataSetConverter = new FiasOperatorDBF(new DirectoryInfo(DBF_Directory), builder.ConnectionString, schemaname);
                var             LoadTaskOld             = Task.Factory.StartNew(() =>
                {
                    fiasDBFDataSetConverter.SPLoad();
                });
                var DownloadTask = LoadTaskOld.ContinueWith(a => fiasDBFDataSetConverter.DownloadFromSite(false));
                //var LoadTask = Task.Factory.StartNew(() => fiasDBFDataSetConverter.BulkLoad(serverTableType));/*DownloadTask*/
                var LoadTask = DownloadTask.ContinueWith(a => fiasDBFDataSetConverter.SPLoad());

                /*var MergeTask = LoadTask.ContinueWith(a =>
                 *  {
                 *      if (a.IsCompleted)
                 *      {
                 *          fiasDBFDataSetConverter.MergeDB(serverTableType);
                 *      }
                 *  });*/
                LoadTask.Wait();
            }
            finally { }
        }
Пример #2
0
 public static void Load(SqlDateTime downloaded)
 {
     using (SqlConnection connection = new SqlConnection("context connection=true"))
     {
         var fias = new FiasOperatorDBF(new DirectoryInfo(Path.GetTempPath()), connection, "fias_tmp");
         fias.DownloadFromSite(false, downloaded.Value);
     }
 }
Пример #3
0
        public void TestMethod1()
        {
            var conn = new SqlConnection("Data Source=BUSHMAKIN;Initial Catalog=UNS;Integrated Security=True");

            conn.Open();
            var b = new FiasOperatorDBF(new System.IO.DirectoryInfo("C:\\Users\\Bushmakin\\Documents\\Новая папка\\Compressed\\fias_dbf"), conn, "dbo");

            b.BulkLoad(ServerTableType.Schema);
        }