Merge branch 'master' into careminster

avinationmerge
Melanie 2009-12-26 00:21:03 +00:00
commit e51be5f4a7
1 changed files with 25 additions and 0 deletions

View File

@ -195,6 +195,31 @@ namespace OpenSim.Data.MySQL
MySqlCommand cmd = new MySqlCommand(); MySqlCommand cmd = new MySqlCommand();
string query = ""; string query = "";
List<String> names = new List<String>();
List<String> values = new List<String>();
foreach (FieldInfo fi in m_Fields.Values)
{
names.Add(fi.Name);
values.Add(fi.GetValue(row).ToString());
}
if (m_DataField != null)
{
Dictionary<string, string> data =
(Dictionary<string, string>)m_DataField.GetValue(row);
foreach (KeyValuePair<string, string> kvp in data)
{
names.Add(kvp.Key);
values.Add(kvp.Value);
}
}
query = String.Format("replace into {0} (`", m_Realm) + String.Join("`,`", names.ToArray()) + "`) values ('" + String.Join("','", values.ToArray()) + "')";
if (ExecuteNonQuery(cmd) > 0)
return true;
return false; return false;
} }