public void ReadDataFromDB(string sqliteFilePath) { m_floorInfo.Clear(); if (sqliteFilePath == null) { TaskDialog.Show("Error", "没有指定DB文件"); } m_sqlite = new MtSQLite(sqliteFilePath); JArray jarr = new JArray(); string quarySql = "SELECT ID,空间,空间编码 FROM " + "'" + m_tableName + "'"; // string quarySql = "SELECT 序号,科室名称,用途 FROM " + "'" + m_tableName + "'"; jarr = m_sqlite.ExecuteQuery(quarySql); foreach (var item in jarr) { //string roomNum = item.Value<string>("序号").Trim(); string id = item.Value <string>("ID").Trim(); string space = item.Value <string>("空间").Trim(); string spaceNum = item.Value <string>("空间编码").Trim(); //string dep = item.Value<string>("科室名称").Trim(); //string use = item.Value<string>("用途").Trim(); //string floorId = level + "-" + roomNum; //string floorId = roomNum; //string info = dep + "*" + use; if (string.IsNullOrEmpty(id) || string.IsNullOrEmpty(space) || string.IsNullOrEmpty(spaceNum)) { continue; } string floorID = id; string info = space + "*" + spaceNum; if (!m_floorInfo.ContainsKey(floorID)) { m_floorInfo.Add(floorID, info); } } }