当前位置: 首页>>代码示例>>C#>>正文


C# DataBaseHelper.ExecuteReader方法代码示例

本文整理汇总了C#中DataBaseHelper.ExecuteReader方法的典型用法代码示例。如果您正苦于以下问题:C# DataBaseHelper.ExecuteReader方法的具体用法?C# DataBaseHelper.ExecuteReader怎么用?C# DataBaseHelper.ExecuteReader使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DataBaseHelper的用法示例。


在下文中一共展示了DataBaseHelper.ExecuteReader方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateUnitNameDropDownList

        public void CreateUnitNameDropDownList(IList<Units> _Units)
        {
            NpgsqlDataReader _dr = null;
            DataBaseHelper _db = new DataBaseHelper(Command, CommandType.Text);
            try
            {
                _dr = _db.ExecuteReader(returnParam());

                _Units.Add(new Units(0, "Create Unit"));

                while (_dr.Read())
                {
                    _Units.Add(new Units(int.Parse(_dr[0].ToString()), _dr[1].ToString()));
                }
            }
            catch (Exception ex)
            {
                throw new Exception(" :: " + ex.Message);
            }
            finally
            {
                if (_dr != null)
                {
                    _db = null;
                    _dr = null;
                    _Units = null;
                }

            }
        }
开发者ID:guarddoggps,项目名称:xtremek,代码行数:30,代码来源:UnitNameSelect.cs

示例2: SecurityQuestionDropDownList

        public void SecurityQuestionDropDownList(IList<SecurityQuestion> _securityQes)
        {
            NpgsqlDataReader _dr = null;
            DataBaseHelper _db = new DataBaseHelper(Command, CommandType.Text);
            try
            {
                _dr = _db.ExecuteReader(base.ConnectionString);

                _securityQes.Add(new SecurityQuestion(0, "Select Question"));

                while (_dr.Read())
                {
                    _securityQes.Add(new SecurityQuestion(int.Parse(_dr[0].ToString()), _dr[1].ToString()));
                }
            }
            catch (Exception ex)
            {
                throw new Exception(" :: " + ex.Message);
            }
            finally
            {
                if(_dr!=null)
                {
                    _db = null;
                    _dr=null;
                    _securityQes = null;
                }

            }
        }
开发者ID:guarddoggps,项目名称:xtremek,代码行数:30,代码来源:SecurityQuestionSelect.cs

示例3: getMapData

        public void getMapData()
        {
            NpgsqlDataReader _dr = null;
            DataBaseHelper _db = new DataBaseHelper(Command, CommandType.StoredProcedure);
            try
            {
                _dr = _db.ExecuteReader(returnParams());

                while (_dr.Read())
                {
                    this._mapdata.Add(new MapData(_dr[0].ToString(), decimal.Parse(_dr[1].ToString()), decimal.Parse(_dr[2].ToString()),
                        _dr[3].ToString(),_dr[4].ToString(),_dr[5].ToString(),_dr[6].ToString(),_dr[7].ToString()));
                }
            }
            catch (Exception ex)
            {
                throw new Exception(" DAL::Select: MainMapData "+ex.Message);
            }

            finally
            {
                _dr=null;
                _db=null;
            }
        }
开发者ID:guarddoggps,项目名称:xtremek,代码行数:25,代码来源:MainMapData.cs

示例4: UserGroupDropDownList

        public void UserGroupDropDownList(IList<UserGroup> _userGroup)
        {
            NpgsqlDataReader _dr = null;
            DataBaseHelper _db = new DataBaseHelper(Command, CommandType.Text);
            try
            {
                _dr = _db.ExecuteReader(returnParam());
                _userGroup.Add(new UserGroup(0, "Select Group"));

                while (_dr.Read())
                {
                    _userGroup.Add(new UserGroup(int.Parse(_dr[0].ToString()), _dr[1].ToString()));
                }
            }
            catch (Exception ex)
            {
                throw new Exception(" :: " + ex.Message);
            }
            finally
            {
                if (_dr != null)
                {
                    _db = null;
                    _dr = null;
                    _userGroup = null;
                }

            }
        }
开发者ID:guarddoggps,项目名称:xtremek,代码行数:29,代码来源:UserGroupSelect.cs

示例5: UnitTypeDropDownList

        public void UnitTypeDropDownList(IList<UnitType> _unitType)
        {
            NpgsqlDataReader _dr = null;
            DataBaseHelper _db = new DataBaseHelper(Command, CommandType.Text);
            try
            {
                _dr = _db.ExecuteReader(returnParams());

                _unitType.Add(new UnitType(0, "Select Unit Category"));

                while (_dr.Read())
                {
                    _unitType.Add(new UnitType(int.Parse(_dr[0].ToString()), _dr[1].ToString()));
                }
            }
            catch (Exception ex)
            {
                throw new Exception(" :: " + ex.Message);
            }
            finally
            {
                if (_dr != null)
                {
                    _db = null;
                    _dr = null;
                    _unitType = null;
                }

            }
        }
开发者ID:guarddoggps,项目名称:xtremek,代码行数:30,代码来源:UnitTypeSelect.cs

示例6: IconLoadOnDataList

        public void IconLoadOnDataList(IList<IconSetup> _ICLists)
        {
            NpgsqlDataReader _dr = null;
            DataBaseHelper _db = new DataBaseHelper(Command, CommandType.Text);
            try
            {
                _dr = _db.ExecuteReader(base.ConnectionString);

                // _GLists.Add(new UserGroup(0, ));

                while (_dr.Read())
                {
                    _ICLists.Add(new IconSetup(int.Parse(_dr[0].ToString()),_dr[1].ToString(), _dr[2].ToString()));
                }
            }
            catch (Exception ex)
            {
                throw new Exception(" :: " + ex.Message);
            }
            finally
            {
                if (_dr != null)
                {
                    _db = null;
                    _dr = null;
                    _ICLists = null;
                }

            }
        }
开发者ID:guarddoggps,项目名称:xtremek,代码行数:30,代码来源:IconSelect.cs

示例7: LoadGroupListBox

        public void LoadGroupListBox(IList<UserGroup> _GLists)
        {
            NpgsqlDataReader _dr = null;
            DataBaseHelper _db = new DataBaseHelper(Command, CommandType.Text);

            try
            {
                _dr = _db.ExecuteReader(returnParam());

                while (_dr.Read())
                {
                    _GLists.Add(new UserGroup(int.Parse(_dr[0].ToString()), _dr[1].ToString()));
                }
            }
            catch (Exception ex)
            {
                throw new Exception(" :: " + ex.Message);
            }
            finally
            {
                if (_dr != null)
                {
                    _db = null;
                    _dr = null;
                    _GLists = null;
                }

            }
        }
开发者ID:guarddoggps,项目名称:xtremek,代码行数:29,代码来源:GroupListSelect.cs

示例8: PatternDropDownList

        public void PatternDropDownList(IList<Pattern> _Pattern)
        {
            NpgsqlDataReader _dr = null;
            DataBaseHelper _db = new DataBaseHelper(Command, CommandType.Text);
            try
            {
                _dr = _db.ExecuteReader(returnParam());

                _Pattern.Add(new Pattern(0, "Select Pattern"));

                while (_dr.Read())
                {
                    _Pattern.Add(new Pattern(int.Parse(_dr[0].ToString()), _dr[1].ToString()));
                }
            }
            catch (Exception ex)
            {
                throw new Exception(" :: " + ex.Message);
            }
            finally
            {
                if(_dr!=null)
                {
                    _db = null;
                    _dr=null;
                    _Pattern = null;
                }

            }
        }
开发者ID:guarddoggps,项目名称:xtremek,代码行数:30,代码来源:PatternSelect.cs

示例9: FuelDropDownList

        public void FuelDropDownList(IList<Fuel> _fuels)
        {
            NpgsqlDataReader _dr = null;
            DataBaseHelper _db = new DataBaseHelper(Command, CommandType.Text);
            try
            {
                _dr = _db.ExecuteReader(base.ConnectionString);

                _fuels.Add(new Fuel(0, "Select Fuel"));

                while (_dr.Read())
                {
                    _fuels.Add(new Fuel(int.Parse(_dr[0].ToString()), _dr[1].ToString()));
                }
            }
            catch (Exception ex)
            {
                throw new Exception(" :: " + ex.Message);
            }
            finally
            {
                if(_dr!=null)
                {
                    _db = null;
                    _dr=null;
                    _fuels = null;
                }

            }
        }
开发者ID:guarddoggps,项目名称:xtremek,代码行数:30,代码来源:FuelSelect.cs

示例10: LoadListedUnitGroups

        public void LoadListedUnitGroups(IList<UserGroup> _GLists)
        {
            Command = @"SELECT typeID,typeName FROM tblUnitType WHERE typeID IN" +
                      @" (SELECT DISTINCT t.typeID FROM tblUnitType t INNER JOIN tblUnits u" +
                      @" ON t.typeID = u.typeID AND u.unitID IN (SELECT unitID FROM tblUnitUserWise" +
                      @" WHERE uID = :uID)) AND comID = :comID AND coalesce(isDelete,'0') != '1'" +
                      @" ORDER BY typeName ASC;";
            NpgsqlDataReader _dr = null;
            DataBaseHelper _db = new DataBaseHelper(Command, CommandType.Text);
            try
            {
                _dr = _db.ExecuteReader(returnUnitGroupParam());

                // _GLists.Add(new UserGroup(0, ));

                while (_dr.Read())
                {
                    _GLists.Add(new UserGroup(int.Parse(_dr[0].ToString()), _dr[1].ToString()));
                }
            }
            catch (Exception ex)
            {
                throw new Exception(" :: " + ex.Message);
            }
            finally
            {
                if (_dr != null)
                {
                    _db = null;
                    _dr = null;
                    _GLists = null;
                }

            }
        }
开发者ID:guarddoggps,项目名称:xtremek,代码行数:35,代码来源:UnitAndUnitGroupSelect.cs

示例11: SchemeDropDownList

        public void SchemeDropDownList(IList<SecurityScheme> _Scheme)
        {
            NpgsqlDataReader _dr = null;
            DataBaseHelper _db = new DataBaseHelper(Command, CommandType.Text);
            try
            {
                _dr = _db.ExecuteReader(GetParams());

                _Scheme.Add(new SecurityScheme(0, "Select Scheme"));

                while (_dr.Read())
                {
                    _Scheme.Add(new SecurityScheme(int.Parse(_dr[0].ToString()), _dr[1].ToString()));
                }
            }
            catch (Exception ex)
            {
                throw new Exception(" :: " + ex.Message);
            }
            finally
            {
                if (_dr != null)
                {
                    _db = null;
                    _dr = null;
                    _Scheme = null;
                }

            }
        }
开发者ID:guarddoggps,项目名称:xtremek,代码行数:30,代码来源:SecuritySchemeSelect.cs

示例12: SelectData1

        public void SelectData1()
        {
            Command = "SELECT unitName,lat,long,deviceID,CAST(velocity * 0.621 AS int) AS velocity," +
                      "recTime,recTimeRevised,iconName FROM unitRecords WHERE deviceID = :deviceID" +
                      " AND comID = :comID AND recTime BETWEEN :recTime	AND (SELECT MAX(recTime) FROM tblGPRS" +
                      " WHERE deviceID = :deviceID AND msgType != 4) ORDER BY recTime DESC LIMIT 25;";

            DataBaseHelper _db = new DataBaseHelper(Command, CommandType.Text);
               	NpgsqlDataReader _dr = null;

            try
            {
                _dr = _db.ExecuteReader(ReturnParams1());
                while(_dr.Read())
                {
                    this._mapdata.Add(new MapData( _dr[0].ToString(), decimal.Parse(_dr[1].ToString()), decimal.Parse(_dr[2].ToString()),
                        _dr[3].ToString(),_dr[4].ToString(),_dr[5].ToString(),_dr[6].ToString(),_dr[7].ToString()));
                }
            }
            catch (Exception ex)
            {
                throw new Exception("DAL::SelectData1::"+ex.Message);
            }
            finally
            {
                _dr = null;
            }
        }
开发者ID:guarddoggps,项目名称:xtremek,代码行数:28,代码来源:BreadCrumbsDataSelect.cs

示例13: TimeZoneDropDownList

        public void TimeZoneDropDownList(IList<RptTimeZone> _TimeZone)
        {
            NpgsqlDataReader _dr = null;
            DataBaseHelper _db = new DataBaseHelper(Command, CommandType.Text);
            try
            {
                _dr = _db.ExecuteReader(base.ConnectionString);

                _TimeZone.Add(new RptTimeZone(0, "Select Time Zone"));

                while (_dr.Read())
                {
                    _TimeZone.Add(new RptTimeZone(float.Parse(_dr[0].ToString()), _dr[1].ToString()));
                }
            }
            catch (Exception ex)
            {
                throw new Exception(" :: " + ex.Message);
            }
            finally
            {
                if (_dr != null)
                {
                    _db = null;
                    _dr = null;
                    _TimeZone = null;
                }

            }
        }
开发者ID:guarddoggps,项目名称:xtremek,代码行数:30,代码来源:TimeZoneSelect.cs

示例14: LoadNotListedUnits

        public void LoadNotListedUnits(IList<UserGroup> _GLists)
        {
            Command = @"SELECT unitID,unitName FROM tblUnits WHERE unitID NOT IN" +
                      @"(SELECT unitID FROM tblUnitUserWise WHERE uID = :uID)" +
                      @"AND coalesce(isDelete,'0') != '1' AND comID = :comID ORDER BY unitName ASC;";

            NpgsqlDataReader _dr = null;
            DataBaseHelper _db = new DataBaseHelper(Command, CommandType.Text);
            try
            {
                _dr = _db.ExecuteReader(returnUnitParam());

                // _GLists.Add(new UserGroup(0, ));

                while (_dr.Read())
                {
                    _GLists.Add(new UserGroup(int.Parse(_dr[0].ToString()), _dr[1].ToString()));
                }
            }
            catch (Exception ex)
            {
                throw new Exception(" :: " + ex.Message);
            }
            finally
            {
                if (_dr != null)
                {
                    _db = null;
                    _dr = null;
                    _GLists = null;
                }

            }
        }
开发者ID:guarddoggps,项目名称:xtremek,代码行数:34,代码来源:UnitAndUnitGroupSelect.cs

示例15: UnitsDropDownList

        public void UnitsDropDownList(IList<Units> _units, string rulesID)
        {
            this.RulesID = int.Parse(rulesID);
            NpgsqlDataReader _dr = null;
            DataBaseHelper _db = new DataBaseHelper(Command, CommandType.Text);
            try
            {
                _dr = _db.ExecuteReader(ReturnParams("units"));

                _units.Add(new Units(0, "Select Units"));

                while (_dr.Read())
                {
                    _units.Add(new Units(int.Parse(_dr[0].ToString()), _dr[1].ToString()));
                }
            }
            catch (Exception ex)
            {
                throw new Exception(" :: " + ex.Message);
            }
            finally
            {
                if (_dr != null)
                {
                    _db = null;
                    _dr = null;
                    _units = null;
                }

            }
        }
开发者ID:guarddoggps,项目名称:xtremek,代码行数:31,代码来源:RulesDataSelect.cs


注:本文中的DataBaseHelper.ExecuteReader方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。