private void fill_ft(string _findLayerName, string _findColumnName)
{
//获取层
MapInfo.Data.Table table = MapInfo.Engine.Session.Current.Catalog.GetTable(_findLayerName);
if (table != null)
{
MIDataReader tr;//跟SQL的Reader类似
MIConnection con = new MIConnection();
MICommand tc = con.CreateCommand();
tc.CommandText = "select " + _findColumnName + " from " + _findLayerName;
con.Open();
tr = tc.ExecuteReader(); //找到条件对应的图元
DropDownList2.Items.Clear();
DropDownList2.Items.Add("=请选择=");
while (tr.Read())
{
DropDownList2.Items.Add(tr.GetString(0));
}
tc.Cancel();
tc.Dispose();
tr.Close();
con.Close();
}
}