本文整理汇总了C#中DataBaseHelper类的典型用法代码示例。如果您正苦于以下问题:C# DataBaseHelper类的具体用法?C# DataBaseHelper怎么用?C# DataBaseHelper使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DataBaseHelper类属于命名空间,在下文中一共展示了DataBaseHelper类的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;
}
}
}
示例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;
}
}
}
示例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;
}
}
}
示例4: Add
public void Add()
{
_showcaseInsertDataParameters = new ShowcaseInsertDataParameters(PageId, ProductId);
DataBaseHelper dbHelper = new DataBaseHelper(StoredProcedureName);
dbHelper.Parameters = _showcaseInsertDataParameters.Parameters;
dbHelper.Run();
}
示例5: Delete
public void Delete()
{
_shoppingCartByGuidDeleteDataParameters = new ShoppingCartByGuidDeleteDataParameters(ShoppingCart);
DataBaseHelper dbHelper = new DataBaseHelper(StoredProcedureName);
dbHelper.Parameters = _shoppingCartByGuidDeleteDataParameters.Parameters;
dbHelper.Run();
}
示例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;
}
}
}
示例7: Add
public void Add()
{
_shoppingCartInsertDataParameters = new ShoppingCartInsertDataParameters(ShoppingCart);
DataBaseHelper dbHelper = new DataBaseHelper(StoredProcedureName);
dbHelper.Parameters = _shoppingCartInsertDataParameters.Parameters;
dbHelper.Run();
}
示例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;
}
}
}
示例9: Get
public DataSet Get()
{
DataSet ds;
DataBaseHelper dbHelper = new DataBaseHelper(StoredProcedureName);
ds = dbHelper.Run(ConnectionString);
return ds;
}
示例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;
}
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
}
}
示例14: Update
public void Update()
{
_productUpdateDataParameters = new ProductUpdateDataParameters(Product, StockLevels);
DataBaseHelper dbHelper = new DataBaseHelper(StoredProcedureName);
dbHelper.Parameters = _productUpdateDataParameters.Parameters;
dbHelper.Run();
}
示例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;
}
}
}