Example #1
0
        /// <summary>
        /// Get synchronize progress
        /// </summary>
        /// <param name="insertRows">output current insert rows</param>
        /// <returns>progress</returns>
        /// <remarks>if synchronize finished, return 100</remarks>
        public double GetProgress(out int insertRows)
        {
            HubbleCommand cmd = new HubbleCommand("exec SP_GetTableSyncProgress {0}", _Conn, _TableName);

            System.Data.DataSet ds = cmd.Query();
            double progress        = double.Parse(ds.Tables[0].Rows[0]["Progress"].ToString());

            insertRows = int.Parse(ds.Tables[0].Rows[0]["InsertRows"].ToString());

            if (progress >= 100 || progress < 0)
            {
                return(100);
            }
            else
            {
                return(progress);
            }
        }