コード例 #1
0
        /// <summary>
        /// 获取简单行信息列表
        /// </summary>
        /// <param name="q">查询参数</param>
        /// <param name="useIndex">是否使用索引</param>
        /// <returns></returns>
        private List <SimpleRowInfo> GetSimpleRowInfos(QueryArgs q, bool useIndex)
        {
            List <SimpleRowInfo> results = new List <SimpleRowInfo>();
            var rdr = _Connection.ExecuteQuery(q.TableName, q.Condition, useIndex);

            while (rdr.Read())
            {
                SimpleRowInfo testType = new SimpleRowInfo();
                if (!String.IsNullOrEmpty(q.TagName))
                {
                    testType.Tag = (int)rdr[q.TagName];
                }
                if (!String.IsNullOrEmpty(q.IDName))
                {
                    testType.ID = rdr[q.IDName].ToString();
                }
                results.Add(testType);
            }

            return(results);
        }
コード例 #2
0
        private void DataExchange(string tableName)
        {
            DataTable         table  = _dataSet.Tables[tableName];
            ParadoxDataReader reader = _pdxConnection.ExecuteQuery(tableName, new RecordQuery.NullCondtion());

            while (reader.Read())
            {
                DataRow row = table.NewRow();
                for (int i = 0; i < reader.FieldCount; i++)
                {
                    row[i] = reader[i];
                }
                // todo 添加数据行前,判断数据是否存在
                if (!IsRowExisted(row, table))
                {
                    table.Rows.Add(row);
                }
            }
        }