Beispiel #1
0
        /// <summary>
        /// Retrieve Metadata for a given source/destination when it is available and connectable.
        /// </summary>
        public bool RetrieveMetaData_Old()
        {
            bool success = false;

            try
            {
                DesignTimeComponent.AcquireConnections(null);
                DesignTimeComponent.ReinitializeMetaData();
                DesignTimeComponent.ReleaseConnections();
                success = true;
            }
            catch (Exception e)
            {
                Console.WriteLine("Could Not Retrieve Metadata; Error:: " + e.Message);
                success = false;
            }
            return(success);
        }
Beispiel #2
0
        public bool RetrieveMetaData()
        {
            bool success = false;

            try
            {
                DesignTimeComponent.AcquireConnections(null);
                success = true;
            }
            catch (System.Runtime.InteropServices.COMException e)
            {
                Console.WriteLine("AcquireConn Error:: " + e.Message + " -- " + e.HResult.ToString());
                success = false;
            }

            if (success)
            {
                try
                {
                    DesignTimeComponent.ReinitializeMetaData();
                }
                catch (Exception e)
                {
                    Console.WriteLine("ReinitializeMetaData Error:: " + e.Message);
                    success = false;
                }
            }

            if (success)
            {
                try
                {
                    DesignTimeComponent.ReleaseConnections();
                }
                catch (Exception e)
                {
                    Console.WriteLine("ReleaseConnections Error:: " + e.Message);
                    success = false;
                }
            }


            return(success);
        }