Changeset 394 for trunk/sources/HeuristicLab.CEDMA.DB/Database.cs
- Timestamp:
- 07/23/08 00:28:11 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.CEDMA.DB/Database.cs
r393 r394 323 323 cnn.Open(); 324 324 using(DbCommand c = cnn.CreateCommand()) { 325 c.CommandText = "Select id, ParentAgentId, name, status, ControllerAgent, rawdata from Agent";325 c.CommandText = "Select id, name, status, ControllerAgent, rawdata from Agent where ParentAgentId isnull"; 326 326 using(DbDataReader r = c.ExecuteReader()) { 327 327 while(r.Read()) { 328 328 AgentEntry agent = new AgentEntry(); 329 agent.ParentAgentId = null; 329 330 agent.Id = r.GetInt32(0); 330 agent.ParentAgentId = r.IsDBNull(1) ? null : new Nullable<long>(r.GetInt32(1)); 331 agent.Name = r.IsDBNull(2)?"-":r.GetString(2); 332 agent.Status = (ProcessStatus)Enum.Parse(typeof(ProcessStatus), r.GetString(3)); 333 agent.ControllerAgent = r.GetBoolean(4); 334 agent.RawData = (byte[])r.GetValue(5); 331 agent.Name = r.IsDBNull(1)?"-":r.GetString(1); 332 agent.Status = (ProcessStatus)Enum.Parse(typeof(ProcessStatus), r.GetString(2)); 333 agent.ControllerAgent = r.GetBoolean(3); 334 agent.RawData = (byte[])r.GetValue(4); 335 335 agents.Add(agent); 336 336 }
Note: See TracChangeset
for help on using the changeset viewer.