/// <summary> /// 获取唯一值按钮 /// </summary> private void btnGetUniqueValues_Click(object sender, EventArgs e) { listBoxUniqueValue.Items.Clear(); string sqlQuery = "Select Distinct " + listBoxFields.Items[listBoxFields.SelectedIndex] + " From " + property.FeatureName; DataTable dt = property.SqlQuery(sqlQuery); foreach (DataRow row in dt.Rows) { listBoxUniqueValue.Items.Add(row.ItemArray[0]); } }
/// <summary> /// 点选 /// </summary> /// <param name="mouseLocation"></param> /// <param name="bounds"></param> /// <param name="centerPos"></param> /// <param name="scale"></param> /// <returns></returns> internal DataTable SelectByPoint(Point mouseLocation, Rectangle bounds, PointF centerPos, double scale) { if (dataType == MySpaceDataType.MyGrid) //栅格图层不选择 { return(null); } List <int> fids = geoFeature.SelectByPoint(mouseLocation, bounds, centerPos, scale); if (fids.Count == 0) //没有要素被选中 { return(null); } string set = "("; for (int i = 0; i < fids.Count; i++) { if (i == 0) { set += fids[i].ToString(); } else { set += "," + fids[i].ToString(); } } string sql = "Select * From " + dataName + " Where fid IN" + set + ");"; return(property.SqlQuery(sql)); }