1
private void updateFeatureToolStripMenuItem_Click(object sender, EventArgs e)
2
{
3
try
4
{
5
MapInfo.Data.Table CNTable = MapInfo.Engine.Session.Current.Catalog.GetTable("Testworld");
6
MapInfo.Data.SearchInfo si = MapInfo.Data.SearchInfoFactory.SearchWhere("Country='China'");
7
MapInfo.Data.IResultSetFeatureCollection irfc = MapInfo.Engine.Session.Current.Catalog.Search(CNTable, si);
8
Feature ftr = irfc[0];
9
ftr["Country"] = "China";
10
// CNTable.UpdateFeature(ftr);
11
MIConnection conn = new MIConnection();
12
conn.Open();
13
MICommand cmd = conn.CreateCommand();
14
cmd.CommandText = "update " + CNTable.Alias + " set obj=@obj,Country =@name where MI_Key =@MIKEY";
15
cmd.Parameters.Add("@obj", ftr.Geometry);
16
cmd.Parameters.Add("@name", "中国");
17
cmd.Parameters.Add("@MIKEY", ftr.Key);
18
cmd.ExecuteNonQuery();
19
20
//change style
21
MapInfo.Styles.CompositeStyle cs = new MapInfo.Styles.CompositeStyle();
22
MapInfo.Styles.BitmapPointStyle bmpStyle = new MapInfo.Styles.BitmapPointStyle();
23
bmpStyle.Name = "YIEL2-32.BMP";
24
bmpStyle.PointSize =28;
25
cs.SymbolStyle = bmpStyle;
26
27
}
28
catch (Exception ex)
29
{
30
MessageBox.Show(ex.ToString());
31
}
32
}
![](/Images/OutliningIndicators/None.gif)
2
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
3
![](/Images/OutliningIndicators/InBlock.gif)
4
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
5
![](/Images/OutliningIndicators/InBlock.gif)
6
![](/Images/OutliningIndicators/InBlock.gif)
7
![](/Images/OutliningIndicators/InBlock.gif)
8
![](/Images/OutliningIndicators/InBlock.gif)
9
![](/Images/OutliningIndicators/InBlock.gif)
10
![](/Images/OutliningIndicators/InBlock.gif)
11
![](/Images/OutliningIndicators/InBlock.gif)
12
![](/Images/OutliningIndicators/InBlock.gif)
13
![](/Images/OutliningIndicators/InBlock.gif)
14
![](/Images/OutliningIndicators/InBlock.gif)
15
![](/Images/OutliningIndicators/InBlock.gif)
16
![](/Images/OutliningIndicators/InBlock.gif)
17
![](/Images/OutliningIndicators/InBlock.gif)
18
![](/Images/OutliningIndicators/InBlock.gif)
19
![](/Images/OutliningIndicators/InBlock.gif)
20
![](/Images/OutliningIndicators/InBlock.gif)
21
![](/Images/OutliningIndicators/InBlock.gif)
22
![](/Images/OutliningIndicators/InBlock.gif)
23
![](/Images/OutliningIndicators/InBlock.gif)
24
![](/Images/OutliningIndicators/InBlock.gif)
25
![](/Images/OutliningIndicators/InBlock.gif)
26
![](/Images/OutliningIndicators/InBlock.gif)
27
![](/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
28
![](/Images/OutliningIndicators/InBlock.gif)
29
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
30
![](/Images/OutliningIndicators/InBlock.gif)
31
![](/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
32
![](/Images/OutliningIndicators/ExpandedBlockEnd.gif)