Reverted SQLite/SQLiteGenericTableHandler to what it was + singleton.

slimupdates
Diva Canto 2010-02-20 20:59:04 -08:00
parent df59d098b3
commit 611eeb583c
1 changed files with 6 additions and 6 deletions

View File

@ -121,7 +121,7 @@ namespace OpenSim.Data.SQLite
for (int i = 0 ; i < fields.Length ; i++)
{
cmd.Parameters.Add(new SqliteParameter(":" + fields[i], keys[i]));
terms.Add("`" + fields[i] + "`='" + keys[i] + "'");
terms.Add("`" + fields[i] + "` = :" + fields[i]);
}
string where = String.Join(" and ", terms.ToArray());
@ -219,8 +219,8 @@ namespace OpenSim.Data.SQLite
foreach (FieldInfo fi in m_Fields.Values)
{
names.Add(fi.Name);
values.Add(fi.GetValue(row).ToString());
cmd.Parameters.Add(new SqliteParameter(fi.Name, fi.GetValue(row).ToString()));
values.Add(":" + fi.Name);
cmd.Parameters.Add(new SqliteParameter(":" + fi.Name, fi.GetValue(row).ToString()));
}
if (m_DataField != null)
@ -231,12 +231,12 @@ namespace OpenSim.Data.SQLite
foreach (KeyValuePair<string, string> kvp in data)
{
names.Add(kvp.Key);
values.Add(kvp.Value);
cmd.Parameters.Add(new SqliteParameter(kvp.Key, kvp.Value));
values.Add(":" + kvp.Key);
cmd.Parameters.Add(new SqliteParameter(":" + kvp.Key, kvp.Value));
}
}
query = String.Format("replace into {0} (`", m_Realm) + String.Join("`,`", names.ToArray()) + "`) values ('" + String.Join("', '", values.ToArray()) + "')";
query = String.Format("replace into {0} (`", m_Realm) + String.Join("`,`", names.ToArray()) + "`) values (" + String.Join(",", values.ToArray()) + ")";
cmd.CommandText = query;