Example #1
0
        private void LoadQueryConfig(string fileName)
        {
            MultiDbQueryConfig cfg = MultiDbHelper.LoadMultiDbQueryConfiguration(fileName);

            if (cfg != null)
            {
                lblServer.Text = cfg.SourceServer;
                this.SetDatabaseList(cfg.SourceServer, cfg.Database);
                this.mruManager.Add(fileName);
                rtbSqlScript.Text = cfg.Query;
            }

            this.isDirty = false;
        }
 public static MultiDbData CreateMultiDbConfigFromQueryFile(string fileName, out string message)
 {
     try
     {
         MultiDbQueryConfig cfg      = MultiDbHelper.LoadMultiDbQueryConfiguration(fileName);
         ConnectionData     connData = new ConnectionData(cfg.SourceServer, cfg.Database);
         return(CreateMultiDbConfigFromQuery(connData, cfg.Query, out message));
     }
     catch (Exception exe)
     {
         message = exe.Message;
         return(null);
     }
 }