diff --git a/FrmFlagDetail.cs b/FrmFlagDetail.cs index d72eee9..cfd9769 100644 --- a/FrmFlagDetail.cs +++ b/FrmFlagDetail.cs @@ -8,6 +8,7 @@ using System.Windows.Forms; using GeoScene.Globe; using System.Data.OracleClient; +using System.Diagnostics; namespace Cyberpipe { @@ -41,7 +42,13 @@ while (reader.Read()) { objectIds = reader.GetString(0); - objectTypeCodes = reader.GetString(1); + if (reader.IsDBNull(1)){ + // 如果第二列为空 + objectTypeCodes = ""; + } + else { + objectTypeCodes = reader.GetString(1); + } } } @@ -62,6 +69,7 @@ { if (Utility.listPipelineType[i].code == codeTypes[n]) { + // 根据类型编号得到类型名称 int index = this.dataGridViewX_markDetail.Rows.Add(); this.dataGridViewX_markDetail.Rows[index].Cells[0].Value = Utility.listPipelineType[i].type; this.dataGridViewX_markDetail.Rows[index].Cells[1].Value = codeIds[n].ToString();