Esempio n. 1
0
        public DbManagerControl(HostService hostService, ShellStruct data)
        {
            InitializeComponent();
            this.Dock = System.Windows.Forms.DockStyle.Fill;

            _hostService = hostService;
            _shellData = data;

            //初始化ExtraSettingXml
            InitExtraSettingXml();

            //绑定事件
            dbManagerService = new DbManagerService(_hostService, _shellData, GetDbType());
            dbManagerService.ConnectDbCompletedToDo += dbManagerService_ConnectDbCompletedToDo;
            dbManagerService.GetDbNameCompletedToDo += dbManagerService_GetDbNameCompletedToDo;
            dbManagerService.GetDbTableNameCompletedToDo += dbManagerService_GetTableNameCompletedToDo;
            dbManagerService.GetColumnTypeCompletedToDo += dbManagerService_GetColumnTypeCompletedToDo;
            dbManagerService.ExecuteReaderCompletedToDo += dbManagerService_ExecuteReaderCompletedToDo;
            dbManagerService.ExecuteNonQueryCompletedToDo += dbManagerService_ExecuteNonQueryCompletedToDo;

            treeView_Dbs.AfterSelect += treeView_Dbs_AfterSelect;

            RefreshServerStatus(false);
            //连接数据库
            dbManagerService.ConnectDb(GetConnStr());
        }
Esempio n. 2
0
        public DbManagerControl(HostService hostService, ShellStruct data)
        {
            InitializeComponent();
            this.Dock = System.Windows.Forms.DockStyle.Fill;

            _hostService = hostService;
            _shellData   = data;

            //初始化ExtraSettingXml
            InitExtraSettingXml();

            //绑定事件
            dbManagerService = new DbManagerService(_hostService, _shellData, GetDbType());
            dbManagerService.ConnectDbCompletedToDo       += dbManagerService_ConnectDbCompletedToDo;
            dbManagerService.GetDbNameCompletedToDo       += dbManagerService_GetDbNameCompletedToDo;
            dbManagerService.GetDbTableNameCompletedToDo  += dbManagerService_GetTableNameCompletedToDo;
            dbManagerService.GetColumnTypeCompletedToDo   += dbManagerService_GetColumnTypeCompletedToDo;
            dbManagerService.ExecuteReaderCompletedToDo   += dbManagerService_ExecuteReaderCompletedToDo;
            dbManagerService.ExecuteNonQueryCompletedToDo += dbManagerService_ExecuteNonQueryCompletedToDo;

            treeView_Dbs.AfterSelect += treeView_Dbs_AfterSelect;

            RefreshServerStatus(false);
            //连接数据库
            dbManagerService.ConnectDb(GetConnStr());
        }
Esempio n. 3
0
        public DbManagerControl(IHost host, Shell data)
        {
            InitializeComponent();
            this.Dock = System.Windows.Forms.DockStyle.Fill;

            _host      = host;
            _shellData = data;

            //绑定事件
            dbManagerService = new DbManagerService(_host, _shellData, GetDbType());
            dbManagerService.ConnectDbCompletedToDo       += dbManagerService_ConnectDbCompletedToDo;
            dbManagerService.GetDbNameCompletedToDo       += dbManagerService_GetDbNameCompletedToDo;
            dbManagerService.GetDbTableNameCompletedToDo  += dbManagerService_GetTableNameCompletedToDo;
            dbManagerService.GetColumnTypeCompletedToDo   += dbManagerService_GetColumnTypeCompletedToDo;
            dbManagerService.ExecuteReaderCompletedToDo   += dbManagerService_ExecuteReaderCompletedToDo;
            dbManagerService.ExecuteNonQueryCompletedToDo += dbManagerService_ExecuteNonQueryCompletedToDo;

            treeView_Dbs.AfterSelect   += treeView_Dbs_AfterSelect;
            rightMenu_TreeView.Opening += rightMenu_TreeView_Opening;

            RefreshServerStatus(false);

            //连接数据库
            dbManagerService.ConnectDb(GetConnStr());
        }
Esempio n. 4
0
 /// <summary>
 /// 连接数据库
 /// </summary>
 private void toolStripButton_connect_Click(object sender, EventArgs e)
 {
     dbManagerService.ConnectDb(GetConnStr());
 }