Use the DBExt query functions
This commit is contained in:
parent
1d042fccaa
commit
cc907b9e09
1 changed files with 4 additions and 8 deletions
|
|
@ -58,15 +58,11 @@ namespace TShockAPI.DB
|
||||||
public void UpdateItemBans()
|
public void UpdateItemBans()
|
||||||
{
|
{
|
||||||
ItemBans.Clear();
|
ItemBans.Clear();
|
||||||
using (var com = database.CreateCommand())
|
|
||||||
{
|
|
||||||
com.CommandText = "SELECT * FROM ItemBans";
|
|
||||||
|
|
||||||
using (var reader = com.ExecuteReader())
|
using (var reader = database.QueryReader("SELECT * FROM ItemBans"))
|
||||||
{
|
{
|
||||||
while (reader != null && reader.Read())
|
while (reader != null && reader.Read())
|
||||||
ItemBans.Add(reader.Get<string>("ItemName"));
|
ItemBans.Add(reader.Get<string>("ItemName"));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void AddNewBan(string itemname = "")
|
public void AddNewBan(string itemname = "")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue