private void Bt_enter_Click(object sender, EventArgs e) { Action <string> alertaction = (string msg) => { MessageBox.Show(this, msg, "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Information); }; if (Tb_dbserver.Text.Trim().Length <= 0) { alertaction("请填写服务器地"); return; } if (Tb_dbname.Text.Trim().Length <= 0) { alertaction("请填写数据库名称"); return; } connstring.AppendFormat(@"Data Source={0}/{1};User ID={2};Unicode=True;Password={3};Enlist=true;Pooling=true;Max Pool Size=300;Min Pool Size=0;Connection Lifetime=300;", Tb_dbserver.Text, Tb_dbname.Text, Tb_user.Text, Tb_pwd.Text); List <string> result = Command.OracleCommand.DataSourceCommand.GetTableColl(connstring.ToString()); //所有表名称 result.AddRange(Command.OracleCommand.DataSourceCommand.GetViewList(connstring.ToString())); //所有试图名称 runcome.ConnectionString = connstring; runcome.OnPassDataEvent(result, connstring.ToString(), Tb_dbname.Text.Trim()); this.Close(); }