public EzConnectionManager(EzProject parentProject, string streamName)
        {
            if (parentProject == null)
                throw new ArgumentNullException("parentProject");
            m_parentProject = parentProject;
            if (!parentProject.ConnectionManagerItems.Contains(streamName))
            {
                m_conn = parentProject.ConnectionManagerItems.Add(GetConnMgrID(), streamName).ConnectionManager;
                m_conn.Name = GetType().Name + ID;
                Name = m_conn.Name;
                m_streamName = streamName;
                return;
            }
            
            m_conn = parentProject.ConnectionManagerItems[streamName].ConnectionManager;

            if (m_conn.CreationName != GetConnMgrID())
                throw new IncorrectAssignException(string.Format("Connection manager with streamName {0} of type {1} already exists and is incompatible with type {2}",
                    streamName, m_conn.CreationName, GetConnMgrID()));

        }
 public EzCacheCM(EzProject parentProject, string streamName, string name) : base(parentProject, streamName, name) { m_cmcache = (RunWrap.IDTSConnectionManagerCache100)m_conn.InnerObject; }
 public EzOracleAdoNetCM(EzProject parentProject, string streamName, string name) : base(parentProject, streamName, name) { }
 public EzSqlAdoNetCM(EzProject parentProject, string streamName) : base(parentProject, streamName) { }
 public EzFlatFileCM(EzProject parentProject, string streamName, string name) : base(parentProject, streamName, name) { }
 public EzDb2OleDbCM(EzProject parentProject, string streamName, string name) : base(parentProject, streamName, name) { }
 public EzOracleOleDbCM(EzProject parentProject, string streamName) : base(parentProject, streamName) { }
 public EzExcelCM(EzProject parentProject, string streamName, string name) : base(parentProject, streamName, name) { }
 public EzOleDbConnectionManager(EzProject parentProject, string streamName, string name) : base(parentProject, streamName, name) { }
        public void PromoteToSCM(EzProject project, string streamName)
        {
            bool found = false;
            int CMPackageLocation = 0;
            if (m_parent == null)
                throw new ArgumentNullException("CM not attached to a package");
            if (project == null)
                throw new ArgumentNullException("Project Null");

            for (int i = 0; i <m_parent.Connections.Count; i++)
            {
                if (m_parent.Connections[i].ID == ID)
                    
                {
                    found = true;
                    CMPackageLocation = i;
                    break;
                }
            }

            if (found)
            {
                m_parent.Connections.Remove(CMPackageLocation);
                project.ConnectionManagerItems.Join(this, streamName);
            }

        }
 public virtual EzConnectionManager Assign(EzProject parentProject, ConnectionManager c)
 {
     m_conn = c;
     m_parentProject = parentProject;
     return this;
 }
 public EzConnectionManager(EzProject parentProject, ConnectionManager c) { Assign(parentProject, c); }