1 /// </summary>
2 /// <param name="sName">图层名</param>
3 /// <param name="stationID">测站编码</param>
4 /// <param name="evalue">值</param>
5 public static void QueryLayerAttribute(string sName,string stationID,double evalue)
6 {
7 if (null!=sName)
8 {
9 Layer layer = m_mapControl.Map.Layers[sName];//获取图层
10 if(null!=layer)
11 {
12 DatasetVector dataset = layer.Dataset as DatasetVector;
13 Recordset recordset = dataset.GetRecordset(false, CursorType.Dynamic);
14 recordset.MoveFirst();
15 if (null != dataset)
16 {
17 for (int i = 0; i < recordset.RecordCount; i++)//遍历属性表
18 {
19 string station = recordset.GetFieldValue("stationID").ToString();
20
21 if (stationID == station)
22 {
23 recordset.Edit();
24 recordset.SetFieldValue("eValue", evalue);
25 recordset.Update();
26 return;
27 }
28 recordset.MoveNext();
29 }
30
31 }
32 }
33 }
34 m_mapControl.Refresh();
35 }