Пример #1
0
 public DataTableStd this[int index]
 {
     get
     {
         return(DataTableStd.ParseStd(this.Tables[index]));
     }
 }
Пример #2
0
        /// <summary>
        /// 复制本表的结构
        /// </summary>
        /// <returns></returns>
        public DataTableStd CloneStd()
        {
            DataTableStd rtn = DataTableStd.ParseStd(this.Value.Copy());

            rtn.Value.Rows.Clear();
            return(rtn);
        }
Пример #3
0
 /// <summary>
 /// 根据columnIndex和rowIndex获取指定table中的值
 /// </summary>
 /// <param name="tableIndex"></param>
 /// <param name="columnIndex"></param>
 /// <param name="rowIndex"></param>
 /// <returns></returns>
 public object GetValue(int tableIndex, int columnIndex, int rowIndex)
 {
     if (this == null)
     {
         return("");
     }
     else if (tableIndex >= this.Tables.Count)
     {
         return("");
     }
     else
     {
         return(DataTableStd.ParseStd(this.Tables[tableIndex]).GetValue(columnIndex, rowIndex));
     }
 }
Пример #4
0
 /// <summary>
 /// 根据过滤条件获得指定栏位的值,如果过滤条件不够精确导致得到的结果过多,将抛出异常
 /// </summary>
 /// <param name="tableIndex"></param>
 /// <param name="columnName"></param>
 /// <param name="filterExpression"></param>
 /// <returns></returns>
 public object GetValueByWhere(int tableIndex, string columnName, string filterExpression)
 {
     if (this == null)
     {
         return("");
     }
     else if (tableIndex >= this.Tables.Count)
     {
         return("");
     }
     else
     {
         return(DataTableStd.ParseStd(this.Tables[tableIndex]).GetValueByWhere(columnName, filterExpression));
     }
 }
Пример #5
0
        /// <summary>
        /// 从游标中填充数据。用于协助没有提供DataAdapter的驱动使用
        /// </summary>
        /// <param name="ddr"></param>
        /// <returns></returns>
        public static DataSetStd FillData(DbDataReader ddr)
        {
            var rtn = new DataSetStd();

            if (ddr != null)
            {
                var index = 0;
                do
                {
                    var dt = DataTableStd.ParseStd(ddr);
                    rtn._tables.Add(dt);
                } while (ddr.NextResult());
            }
            return(rtn);
        }