Beispiel #1
0
        /// <summary>
        /// 连接数据库
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnConnect_Click(object sender, EventArgs e)
        {
            //ConnectAndGetDatabaseNames()
            DabaseConnectionInfo dcInfo = new DabaseConnectionInfo
            {
                Server   = this.Server,
                Port     = this.Port,
                UserName = this.UserName,
                PassWord = this.PassWord
            };

            string[] databaseNames = axOperation.ConnectAndGetDatabaseNames(this.ConnectionType, dcInfo);
            this.cbDatabases.DataSource    = databaseNames;
            this.cbDatabases.SelectedIndex = 0;
        }
Beispiel #2
0
        private void toolStripAddDatasource_Click(object sender, EventArgs e)
        {
            DataSourceForm dsForm = new DataSourceForm(false, controlOperation);
            if (dsForm.ShowDialog() == DialogResult.OK)
            {
                DabaseConnectionInfo dcInfor = new DabaseConnectionInfo
                {
                    Server = dsForm.Server,
                    Port = dsForm.Port,
                    Database = dsForm.Database,
                    UserName = dsForm.UserName,
                    PassWord = dsForm.PassWord
                };

                controlOperation.ConnectAndGetDatabaseNames(dsForm.ConnectionType, dcInfor);
                //controlOperation.BindDataToCatalogTree();
            }
        }