aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MySQL/MySQLFSAssetData.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Data/MySQL/MySQLFSAssetData.cs')
-rw-r--r--OpenSim/Data/MySQL/MySQLFSAssetData.cs27
1 files changed, 14 insertions, 13 deletions
diff --git a/OpenSim/Data/MySQL/MySQLFSAssetData.cs b/OpenSim/Data/MySQL/MySQLFSAssetData.cs
index 2fb81ae..ce40c03 100644
--- a/OpenSim/Data/MySQL/MySQLFSAssetData.cs
+++ b/OpenSim/Data/MySQL/MySQLFSAssetData.cs
@@ -316,15 +316,16 @@ namespace OpenSim.Data.MySQL
316 return 0; 316 return 0;
317 } 317 }
318 318
319 MySqlCommand cmd = conn.CreateCommand(); 319 using(MySqlCommand cmd = conn.CreateCommand())
320
321 cmd.CommandText = String.Format("select count(*) as count from {0}", m_Table);
322
323 using (IDataReader reader = cmd.ExecuteReader())
324 { 320 {
325 reader.Read(); 321 cmd.CommandText = String.Format("select count(*) as count from {0}",m_Table);
322
323 using (IDataReader reader = cmd.ExecuteReader())
324 {
325 reader.Read();
326 326
327 count = Convert.ToInt32(reader["count"]); 327 count = Convert.ToInt32(reader["count"]);
328 }
328 } 329 }
329 } 330 }
330 331
@@ -333,15 +334,15 @@ namespace OpenSim.Data.MySQL
333 334
334 public bool Delete(string id) 335 public bool Delete(string id)
335 { 336 {
336 MySqlCommand cmd = new MySqlCommand(); 337 using(MySqlCommand cmd = new MySqlCommand())
337 338 {
338 cmd.CommandText = String.Format("delete from {0} where id = ?id", m_Table);
339 339
340 cmd.Parameters.AddWithValue("?id", id); 340 cmd.CommandText = String.Format("delete from {0} where id = ?id",m_Table);
341 341
342 ExecuteNonQuery(cmd); 342 cmd.Parameters.AddWithValue("?id", id);
343 343
344 cmd.Dispose(); 344 ExecuteNonQuery(cmd);
345 }
345 346
346 return true; 347 return true;
347 } 348 }