InC #ImplementationMapXThere are two problems in forming a new layer for reading data from the database:
1.MapXRead data from the database to form a new layer;
2.SetDataTableConvertADOOfRecordset.
The second problem is caused by the first one, becauseMapXIsCOMControl, and it only supportsADOAndC #It is generally used for programming.ADO. NETMethod. Therefore, you need to perform a conversion between the two methods. (You can alsoC #Used inADOMethod, but this is a lagging method after all. For the solution, refer to the article 《Visual Basic. NETUsed inADOAccess the database).
For the solution to the second problem, see the author's article titledDataTableConvert objectsRecordsetObject (aspx "> http://blog.csdn.net/allentao/archive/2005/05/11/373634.aspx), this article only describesRecordsetObject, how to solve the first problem.
The procedure is as follows:
1.CreateCMapXFieldsObject, and add fields to the fields in the database;
2.CreateCMapXBindLayerObject, specify the serial number of its coordinate value field;
3.DirectionMap. DataSets