Ejemplo n.º 1
0
        private void FConnect_SelectClick(object sender, SelectFromListEventArgs e)
        {
            var res     = dataList1.GetRowObject();
            var connStr = (string)res?.GetType().GetProperty("connStr").GetValue(res);
            var conn    = new SqlConnection(connStr);

            if (!Ctx.CheckConnection(conn))
            {
                e.Handled    = true;
                DialogResult = DialogResult.Cancel;
            }
            else
            {
                Ctx.Conn         = conn;
                e.SelectedObject = connStr;
                DialogResult     = DialogResult.OK;
            }
        }