private int ImportConnection(string connectionName, string connectionString)
        {
            var portalSettings = (PortalSettings)(HttpContext.Current.Items["PortalSettings"]);

            var ctrl = new ConnectionController();

            // see if we can find the connection string and return the id
            var connections = ctrl.ListConnection(Convert.ToInt32(portalSettings.PortalId), false, false);

            foreach (ConnectionInfo info in connections)
            {
                if (info.ConnectionString == connectionString)
                {
                    return(info.ConnectionId);
                }
            }

            // we'll have to make a new one
            var connectionId = default(int);

            connectionId = ctrl.UpdateConnection(Convert.ToInt32(portalSettings.PortalId), -1, connectionName, connectionString);

            return(connectionId);
        }
        private void SaveConnection()
        {
            var objConnectionController = new ConnectionController();

            ConnectionId = objConnectionController.UpdateConnection(PortalId, ConnectionId, txtName.Text, txtConnectionString.Text);
        }