• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# DataBaseHelper类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



DataBaseHelper类属于命名空间,在下文中一共展示了DataBaseHelper类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: 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


示例4: Add

 public void Add()
 {
     _showcaseInsertDataParameters = new ShowcaseInsertDataParameters(PageId, ProductId);
     DataBaseHelper dbHelper = new DataBaseHelper(StoredProcedureName);
     dbHelper.Parameters = _showcaseInsertDataParameters.Parameters;
     dbHelper.Run();
 }
开发者ID:simonbegg,项目名称:LiveFreeRange,代码行数:7,代码来源:ShowcaseInsertData.cs


示例5: Delete

 public void Delete()
 {
     _shoppingCartByGuidDeleteDataParameters = new ShoppingCartByGuidDeleteDataParameters(ShoppingCart);
     DataBaseHelper dbHelper = new DataBaseHelper(StoredProcedureName);
     dbHelper.Parameters = _shoppingCartByGuidDeleteDataParameters.Parameters;
     dbHelper.Run();
 }
开发者ID:simonbegg,项目名称:LiveFreeRange,代码行数:7,代码来源:ShoppingCartByGuidDeleteData.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: Add

 public void Add()
 {
     _shoppingCartInsertDataParameters = new ShoppingCartInsertDataParameters(ShoppingCart);
     DataBaseHelper dbHelper = new DataBaseHelper(StoredProcedureName);
     dbHelper.Parameters = _shoppingCartInsertDataParameters.Parameters;
     dbHelper.Run();
 }
开发者ID:simonbegg,项目名称:LiveFreeRange,代码行数:7,代码来源:ShoppingCartInsertData.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: Get

 public DataSet Get()
 {
     DataSet ds;
     DataBaseHelper dbHelper = new DataBaseHelper(StoredProcedureName);
     ds = dbHelper.Run(ConnectionString);
     return ds;
 }
开发者ID:simonbegg,项目名称:LiveFreeRange,代码行数:7,代码来源:ColourSelectData.cs


示例10: 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


示例11: 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


示例12: GetReverseGeocoding

        public void GetReverseGeocoding()
        {
            DataBaseHelper _db = new DataBaseHelper(Command, CommandType.StoredProcedure);
            DataSet ds = new DataSet();
            try
            {
                // Use the reverse geocoding database connection string. VERY IMPORTANT so
                // Reverse Geocoding will work!
                ds = _db.Run(base.RGConnectionString, ReturnParams());

                if (ds.Tables[0].Rows.Count > 0) {
                    // Get the postal code
                    postalCode = ds.Tables[0].Rows[0]["postalCode"].ToString();
                    // Get the city
                    city = ds.Tables[0].Rows[0]["placeName"].ToString();
                    // Get the county
                    county = ds.Tables[0].Rows[0]["adminName2"].ToString();
                    // Get the state
                    state = ds.Tables[0].Rows[0]["adminName1"].ToString();
                    // Get the country
                    country = ds.Tables[0].Rows[0]["countryCode"].ToString();
                }
            }
            catch (Exception ex)
            {
                throw new Exception(" AlarmasABC.DAL.ReverseGeocoding:: " + ex.Message);
            }
            finally
            {
                _db = null;
            }
        }
开发者ID:guarddoggps,项目名称:xtremek,代码行数:32,代码来源:ReverseGeocoding.cs


示例13: 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


示例14: Update

 public void Update()
 {
     _productUpdateDataParameters = new ProductUpdateDataParameters(Product, StockLevels);
     DataBaseHelper dbHelper = new DataBaseHelper(StoredProcedureName);
     dbHelper.Parameters = _productUpdateDataParameters.Parameters;
     dbHelper.Run();
 }
开发者ID:simonbegg,项目名称:LiveFreeRange,代码行数:7,代码来源:ProductUpdateData.cs


示例15: 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


示例16: GetAlert

        public void GetAlert()
        {
            DataBaseHelper _db = new DataBaseHelper(Command, CommandType.Text);
            try
            {
                DataSet _ds;
                _ds = _db.Run(base.ConnectionString, ReturnParams());

             	_alert.AlertTime = _alertTime;

                if (_ds.Tables[0].Rows.Count > 0) {
                    _alert.AlertType = _ds.Tables[0].Rows[0]["alertType"].ToString();
                    _alert.AlertMessage =_ds.Tables[0].Rows[0]["alertMessage"].ToString();
                } else {
                    _alert.AlertType = "None";
                    _alert.AlertMessage = "";
                }
            }
            catch (Exception ex)
            {
                throw new Exception("AlarmasABC.DAL.AlertSelect: " + ex.Message);
            }
            finally
            {
                _db = null;
            }
        }
开发者ID:guarddoggps,项目名称:xtremek,代码行数:27,代码来源:AlertSelect.cs


示例17: 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


示例18: Add

 public void Add(SqlTransaction transaction)
 {
     _orderInsertDataParameters = new OrderInsertDataParameters(Orders);
     DataBaseHelper dbHelper = new DataBaseHelper(StoredProcedureName);
     object id = dbHelper.RunScalar(transaction, _orderInsertDataParameters.Parameters);
     Orders.OrderId = int.Parse(id.ToString());
 }
开发者ID:simonbegg,项目名称:LiveFreeRange,代码行数:7,代码来源:OrderInsertData.cs


示例19: 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


示例20: 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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# DataBaseType类代码示例发布时间:2022-05-24
下一篇:
C# DataBaseConnection类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap