diff options
author | Diva Canto | 2010-02-20 20:59:04 -0800 |
---|---|---|
committer | Diva Canto | 2010-02-20 20:59:04 -0800 |
commit | 611eeb583c2e8c7a750201bc10c535410e74330f (patch) | |
tree | 7b925c0127764f7716061c2216ca2995790a8322 | |
parent | SQLite connector better, but access to tables still doesn't work. (diff) | |
download | opensim-SC-611eeb583c2e8c7a750201bc10c535410e74330f.zip opensim-SC-611eeb583c2e8c7a750201bc10c535410e74330f.tar.gz opensim-SC-611eeb583c2e8c7a750201bc10c535410e74330f.tar.bz2 opensim-SC-611eeb583c2e8c7a750201bc10c535410e74330f.tar.xz |
Reverted SQLite/SQLiteGenericTableHandler to what it was + singleton.
-rw-r--r-- | OpenSim/Data/SQLite/SQLiteGenericTableHandler.cs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/OpenSim/Data/SQLite/SQLiteGenericTableHandler.cs b/OpenSim/Data/SQLite/SQLiteGenericTableHandler.cs index 98943a0..e7e158d 100644 --- a/OpenSim/Data/SQLite/SQLiteGenericTableHandler.cs +++ b/OpenSim/Data/SQLite/SQLiteGenericTableHandler.cs | |||
@@ -121,7 +121,7 @@ namespace OpenSim.Data.SQLite | |||
121 | for (int i = 0 ; i < fields.Length ; i++) | 121 | for (int i = 0 ; i < fields.Length ; i++) |
122 | { | 122 | { |
123 | cmd.Parameters.Add(new SqliteParameter(":" + fields[i], keys[i])); | 123 | cmd.Parameters.Add(new SqliteParameter(":" + fields[i], keys[i])); |
124 | terms.Add("`" + fields[i] + "`='" + keys[i] + "'"); | 124 | terms.Add("`" + fields[i] + "` = :" + fields[i]); |
125 | } | 125 | } |
126 | 126 | ||
127 | string where = String.Join(" and ", terms.ToArray()); | 127 | string where = String.Join(" and ", terms.ToArray()); |
@@ -219,8 +219,8 @@ namespace OpenSim.Data.SQLite | |||
219 | foreach (FieldInfo fi in m_Fields.Values) | 219 | foreach (FieldInfo fi in m_Fields.Values) |
220 | { | 220 | { |
221 | names.Add(fi.Name); | 221 | names.Add(fi.Name); |
222 | values.Add(fi.GetValue(row).ToString()); | 222 | values.Add(":" + fi.Name); |
223 | cmd.Parameters.Add(new SqliteParameter(fi.Name, fi.GetValue(row).ToString())); | 223 | cmd.Parameters.Add(new SqliteParameter(":" + fi.Name, fi.GetValue(row).ToString())); |
224 | } | 224 | } |
225 | 225 | ||
226 | if (m_DataField != null) | 226 | if (m_DataField != null) |
@@ -231,12 +231,12 @@ namespace OpenSim.Data.SQLite | |||
231 | foreach (KeyValuePair<string, string> kvp in data) | 231 | foreach (KeyValuePair<string, string> kvp in data) |
232 | { | 232 | { |
233 | names.Add(kvp.Key); | 233 | names.Add(kvp.Key); |
234 | values.Add(kvp.Value); | 234 | values.Add(":" + kvp.Key); |
235 | cmd.Parameters.Add(new SqliteParameter(kvp.Key, kvp.Value)); | 235 | cmd.Parameters.Add(new SqliteParameter(":" + kvp.Key, kvp.Value)); |
236 | } | 236 | } |
237 | } | 237 | } |
238 | 238 | ||
239 | query = String.Format("replace into {0} (`", m_Realm) + String.Join("`,`", names.ToArray()) + "`) values ('" + String.Join("', '", values.ToArray()) + "')"; | 239 | query = String.Format("replace into {0} (`", m_Realm) + String.Join("`,`", names.ToArray()) + "`) values (" + String.Join(",", values.ToArray()) + ")"; |
240 | 240 | ||
241 | cmd.CommandText = query; | 241 | cmd.CommandText = query; |
242 | 242 | ||