Exemplo n.º 1
0
        private void TopMenuItem2_Click(object sender, EventArgs e)
        {
            DbConfigInfo dbConfigInfo = DbConfigUtil.GetDbConfig();

            if (dbConfigInfo != null)
            {
                Global.GetInstance().DB = dbConfigInfo;
            }

            try
            {
                Global.GetInstance().Tables = BSqlFunction.GetInstance().GetTables();
                CreateTreeNode();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Exemplo n.º 2
0
 private void InitData()
 {
     _dbConfigInfo      = DbConfigUtil.GetDbConfig();
     txtServerName.Text = _dbConfigInfo.ServerName;
     txtUserName.Text   = _dbConfigInfo.UserName;
     txtPwd.Text        = _dbConfigInfo.UserPassword;
     txtPort.Text       = _dbConfigInfo.Port.ToString("D");
     txtDataBase.Text   = _dbConfigInfo.DataBase;
     if (_dbConfigInfo.DbType == SQLDbTypes.MySQL)
     {
         rbMySQL.Checked = true;
     }
     else
     {
         rbSQLServer.Checked = true;
     }
     //cmbbSQLType.SelectedValue = dbConfigInfo.DbType;
     //cmbbSQLType.SelectedIndex = cmbbSQLType.Items.IndexOf(dbConfigInfo.DbType);
     //cmbbSQLType.SelectedText = dbConfigInfo.DbType;
 }