Beispiel #1
0
        private DataTable GetLocalData(MyArgs syncData)
        {
            if (syncData == null)
            {
                return(null);
            }
            string sql = string.Format("select * from (select BINARY_CHECKSUM(*) as CheckSum,ROW_NUMBER() over(order by {0} asc) as RowNum,* from {1}) as tblT where {0}>=@minKey and {0}<=@maxKey;", syncData.Key, syncData.TblName);
            Dictionary <string, object> pms = new Dictionary <string, object>();

            pms.Add("@maxKey", syncData.MaxKey);
            pms.Add("@minKey", syncData.MinKey);
            DataTable dt = new DataTable();

            try { dt = LocalServer.QueryTable(sql, pms); }
            catch (Exception)
            {
                dt = null;
            }
            return(dt);
        }