Use the DBExt query functions

This commit is contained in:
high 2011-08-02 17:24:30 -04:00
parent 1d042fccaa
commit cc907b9e09

View file

@ -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 = "")