From 0171e76246b2e889966b33fc1700a331d8f532db Mon Sep 17 00:00:00 2001 From: Dr Scofield Date: Fri, 18 Jul 2008 10:57:18 +0000 Subject: [PATCH] squashing further warnings. --- OpenSim/Data/MySQL/MySQLEstateData.cs | 38 +++++++++---------- .../Data/NHibernate/NHibernateRegionData.cs | 2 +- OpenSim/Data/SQLite/SQLiteEstateData.cs | 2 +- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/OpenSim/Data/MySQL/MySQLEstateData.cs b/OpenSim/Data/MySQL/MySQLEstateData.cs index 052c40484c..17cd6a18a9 100644 --- a/OpenSim/Data/MySQL/MySQLEstateData.cs +++ b/OpenSim/Data/MySQL/MySQLEstateData.cs @@ -166,7 +166,7 @@ namespace OpenSim.Data.MySQL MySqlCommand cmd = m_connection.CreateCommand(); cmd.CommandText = sql; - cmd.Parameters.Add("?RegionID", regionID.ToString()); + cmd.Parameters.AddWithValue("?RegionID", regionID.ToString()); IDataReader r = cmd.ExecuteReader(); @@ -209,13 +209,13 @@ namespace OpenSim.Data.MySQL if(m_FieldMap[name].GetValue(es) is bool) { if((bool)m_FieldMap[name].GetValue(es)) - cmd.Parameters.Add("?"+name, "1"); + cmd.Parameters.AddWithValue("?"+name, "1"); else - cmd.Parameters.Add("?"+name, "0"); + cmd.Parameters.AddWithValue("?"+name, "0"); } else { - cmd.Parameters.Add("?"+name, m_FieldMap[name].GetValue(es).ToString()); + cmd.Parameters.AddWithValue("?"+name, m_FieldMap[name].GetValue(es).ToString()); } } @@ -233,8 +233,8 @@ namespace OpenSim.Data.MySQL r.Close(); cmd.CommandText = "insert into estate_map values (?RegionID, ?EstateID)"; - cmd.Parameters.Add("?RegionID", regionID.ToString()); - cmd.Parameters.Add("?EstateID", es.EstateID.ToString()); + cmd.Parameters.AddWithValue("?RegionID", regionID.ToString()); + cmd.Parameters.AddWithValue("?EstateID", es.EstateID.ToString()); // This will throw on dupe key try @@ -249,7 +249,7 @@ namespace OpenSim.Data.MySQL // cmd.Parameters.Clear(); cmd.CommandText = "insert into estateban select "+es.EstateID.ToString()+", bannedUUID, bannedIp, bannedIpHostMask, '' from regionban where regionban.regionUUID = ?UUID"; - cmd.Parameters.Add("?UUID", regionID.ToString()); + cmd.Parameters.AddWithValue("?UUID", regionID.ToString()); try { @@ -283,13 +283,13 @@ namespace OpenSim.Data.MySQL if(m_FieldMap[name].GetValue(es) is bool) { if((bool)m_FieldMap[name].GetValue(es)) - cmd.Parameters.Add("?"+name, "1"); + cmd.Parameters.AddWithValue("?"+name, "1"); else - cmd.Parameters.Add("?"+name, "0"); + cmd.Parameters.AddWithValue("?"+name, "0"); } else { - cmd.Parameters.Add("?"+name, m_FieldMap[name].GetValue(es).ToString()); + cmd.Parameters.AddWithValue("?"+name, m_FieldMap[name].GetValue(es).ToString()); } } @@ -310,7 +310,7 @@ namespace OpenSim.Data.MySQL MySqlCommand cmd = m_connection.CreateCommand(); cmd.CommandText = "select bannedUUID from estateban where EstateID = ?EstateID"; - cmd.Parameters.Add("?EstateID", es.EstateID); + cmd.Parameters.AddWithValue("?EstateID", es.EstateID); IDataReader r = cmd.ExecuteReader(); @@ -336,7 +336,7 @@ namespace OpenSim.Data.MySQL MySqlCommand cmd = m_connection.CreateCommand(); cmd.CommandText = "delete from estateban where EstateID = ?EstateID"; - cmd.Parameters.Add("?EstateID", es.EstateID.ToString()); + cmd.Parameters.AddWithValue("?EstateID", es.EstateID.ToString()); cmd.ExecuteNonQuery(); @@ -346,8 +346,8 @@ namespace OpenSim.Data.MySQL foreach(EstateBan b in es.EstateBans) { - cmd.Parameters.Add("?EstateID", es.EstateID.ToString()); - cmd.Parameters.Add("?bannedUUID", b.bannedUUID.ToString()); + cmd.Parameters.AddWithValue("?EstateID", es.EstateID.ToString()); + cmd.Parameters.AddWithValue("?bannedUUID", b.bannedUUID.ToString()); cmd.ExecuteNonQuery(); cmd.Parameters.Clear(); @@ -361,7 +361,7 @@ namespace OpenSim.Data.MySQL MySqlCommand cmd = m_connection.CreateCommand(); cmd.CommandText = "delete from "+table+" where EstateID = ?EstateID"; - cmd.Parameters.Add("?EstateID", EstateID.ToString()); + cmd.Parameters.AddWithValue("?EstateID", EstateID.ToString()); cmd.ExecuteNonQuery(); @@ -371,8 +371,8 @@ namespace OpenSim.Data.MySQL foreach(LLUUID uuid in data) { - cmd.Parameters.Add("?EstateID", EstateID.ToString()); - cmd.Parameters.Add("?uuid", uuid.ToString()); + cmd.Parameters.AddWithValue("?EstateID", EstateID.ToString()); + cmd.Parameters.AddWithValue("?uuid", uuid.ToString()); cmd.ExecuteNonQuery(); cmd.Parameters.Clear(); @@ -388,13 +388,13 @@ namespace OpenSim.Data.MySQL MySqlCommand cmd = m_connection.CreateCommand(); cmd.CommandText = "select uuid from "+table+" where EstateID = ?EstateID"; - cmd.Parameters.Add("?EstateID", EstateID); + cmd.Parameters.AddWithValue("?EstateID", EstateID); IDataReader r = cmd.ExecuteReader(); while(r.Read()) { - EstateBan eb = new EstateBan(); + // EstateBan eb = new EstateBan(); LLUUID uuid = new LLUUID(); LLUUID.TryParse(r["uuid"].ToString(), out uuid); diff --git a/OpenSim/Data/NHibernate/NHibernateRegionData.cs b/OpenSim/Data/NHibernate/NHibernateRegionData.cs index 2014e24c12..3d2d0e60ca 100644 --- a/OpenSim/Data/NHibernate/NHibernateRegionData.cs +++ b/OpenSim/Data/NHibernate/NHibernateRegionData.cs @@ -298,7 +298,7 @@ namespace OpenSim.Data.NHibernate Terrain t = session.Load(typeof(Terrain), regionID) as Terrain; return t.Doubles; } - catch (ObjectNotFoundException e) + catch (ObjectNotFoundException) { m_log.Info("No terrain yet"); return null; diff --git a/OpenSim/Data/SQLite/SQLiteEstateData.cs b/OpenSim/Data/SQLite/SQLiteEstateData.cs index 2d046f2560..ada34a2092 100644 --- a/OpenSim/Data/SQLite/SQLiteEstateData.cs +++ b/OpenSim/Data/SQLite/SQLiteEstateData.cs @@ -318,7 +318,7 @@ namespace OpenSim.Data.MySQL while(r.Read()) { - EstateBan eb = new EstateBan(); + // EstateBan eb = new EstateBan(); LLUUID uuid = new LLUUID(); LLUUID.TryParse(r["uuid"].ToString(), out uuid);