Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/22/08 23:29:18 (16 years ago)
Author:
gkronber
Message:

worked on very basic control to view the tree of agents/runs (ticket #188)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.CEDMA.DB/Database.cs

    r392 r393  
    298298          statusParameter.Value = status.ToString();
    299299          c.Parameters.Add(statusParameter);
    300 
    301300          SQLiteDataReader r = c.ExecuteReader();
    302301          while(r.Read()) {
     
    330329                agent.Id = r.GetInt32(0);
    331330                agent.ParentAgentId = r.IsDBNull(1) ? null : new Nullable<long>(r.GetInt32(1));
    332                 agent.Name = r.GetString(2);
     331                agent.Name = r.IsDBNull(2)?"-":r.GetString(2);
    333332                agent.Status = (ProcessStatus)Enum.Parse(typeof(ProcessStatus), r.GetString(3));
    334333                agent.ControllerAgent = r.GetBoolean(4);
     
    353352          using(DbCommand c = cnn.CreateCommand()) {
    354353            c.CommandText = "Select id, name, status, controllerAgent, rawdata from Agent where ParentAgentId=@ParentAgentId";
     354            DbParameter parentParameter = c.CreateParameter();
     355            parentParameter.ParameterName = "@ParentAgentId";
     356            parentParameter.Value = parentAgentId;
     357            c.Parameters.Add(parentParameter);
     358
    355359            using(DbDataReader r = c.ExecuteReader()) {
    356360              while(r.Read()) {
     
    358362                agent.ParentAgentId = parentAgentId;
    359363                agent.Id = r.GetInt32(0);
    360                 agent.Name = r.GetString(1);
     364                agent.Name = r.IsDBNull(1)?"-":r.GetString(1);
    361365                agent.Status = (ProcessStatus)Enum.Parse(typeof(ProcessStatus), r.GetString(2));
    362366                agent.ControllerAgent = r.GetBoolean(3);
Note: See TracChangeset for help on using the changeset viewer.