aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/SQLite/SQLiteUserAccountData.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-11-14 04:45:59 +0000
committerJustin Clark-Casey (justincc)2012-11-14 04:45:59 +0000
commit94da908813e42c328572bc5da2ddc41b6664b59c (patch)
tree1a3e1ffaadb34cac64c798f5cc06eadf612c6af9 /OpenSim/Data/SQLite/SQLiteUserAccountData.cs
parentIf no ISimulationDataStore or IEstateDataStore implementations could be loade... (diff)
downloadopensim-SC_OLD-94da908813e42c328572bc5da2ddc41b6664b59c.zip
opensim-SC_OLD-94da908813e42c328572bc5da2ddc41b6664b59c.tar.gz
opensim-SC_OLD-94da908813e42c328572bc5da2ddc41b6664b59c.tar.bz2
opensim-SC_OLD-94da908813e42c328572bc5da2ddc41b6664b59c.tar.xz
More consistently dispose of SqliteCommand in OpenSim.Data.SQLite where possible.
Not doing SQLiteInventoryStore since this is no longer used and should disappear in the future.
Diffstat (limited to '')
-rw-r--r--OpenSim/Data/SQLite/SQLiteUserAccountData.cs25
1 files changed, 13 insertions, 12 deletions
diff --git a/OpenSim/Data/SQLite/SQLiteUserAccountData.cs b/OpenSim/Data/SQLite/SQLiteUserAccountData.cs
index 7a5de50..f98d376 100644
--- a/OpenSim/Data/SQLite/SQLiteUserAccountData.cs
+++ b/OpenSim/Data/SQLite/SQLiteUserAccountData.cs
@@ -66,20 +66,21 @@ namespace OpenSim.Data.SQLite
66 if (words.Length > 2) 66 if (words.Length > 2)
67 return new UserAccountData[0]; 67 return new UserAccountData[0];
68 68
69 SqliteCommand cmd = new SqliteCommand(); 69 using (SqliteCommand cmd = new SqliteCommand())
70
71 if (words.Length == 1)
72 {
73 cmd.CommandText = String.Format("select * from {0} where (ScopeID='{1}' or ScopeID='00000000-0000-0000-0000-000000000000') and (FirstName like '{2}%' or LastName like '{2}%')",
74 m_Realm, scopeID.ToString(), words[0]);
75 }
76 else
77 { 70 {
78 cmd.CommandText = String.Format("select * from {0} where (ScopeID='{1}' or ScopeID='00000000-0000-0000-0000-000000000000') and (FirstName like '{2}%' or LastName like '{3}%')", 71 if (words.Length == 1)
79 m_Realm, scopeID.ToString(), words[0], words[1]); 72 {
80 } 73 cmd.CommandText = String.Format("select * from {0} where (ScopeID='{1}' or ScopeID='00000000-0000-0000-0000-000000000000') and (FirstName like '{2}%' or LastName like '{2}%')",
74 m_Realm, scopeID.ToString(), words[0]);
75 }
76 else
77 {
78 cmd.CommandText = String.Format("select * from {0} where (ScopeID='{1}' or ScopeID='00000000-0000-0000-0000-000000000000') and (FirstName like '{2}%' or LastName like '{3}%')",
79 m_Realm, scopeID.ToString(), words[0], words[1]);
80 }
81 81
82 return DoQuery(cmd); 82 return DoQuery(cmd);
83 }
83 } 84 }
84 } 85 }
85} 86}