Hi:
Thanks by your help, but fortunally I founded my error, and now I have the next code for get all the atributes from a layer in a specific point.
There are two methods one search on the layer and the other get all the atributes from this layer and returns the data in to a array.
/// <summary>
/// This method get the info on only one layer under the point
/// </summary>
/// <param name="pmapMap">The map</param>
/// <param name="ppntPoint">The point under we are goig to try search</param>
/// <param name="intPositionLayer">The position of the layer in the map, zero is the initial position</param>
/// <param name="pdblFactor">The factor is the distance between the points 1 and 2 that form the bounding box</param>
/// <returns></returns>
private ArrayList GetInfoFeatures(Map pmapMap, SharpMap.Geometries.Point ppntPoint, int intPositionLayer, double pdblFactor)
{
ArrayList arlResult = new ArrayList();
try
{
SharpMap.Layers.VectorLayer lyrMyLayer = _LayerTools.getVectorLayer(pmapMap, intPositionLayer);//get the layer
SharpMap.Data.FeatureDataSet fds = new SharpMap.Data.FeatureDataSet();//Where the features will be stored
SharpMap.Geometries.Point pntPoint2 = new SharpMap.Geometries.Point(ppntPoint.X + pdblFactor, ppntPoint.Y + pdblFactor);//The second point in the square
SharpMap.Geometries.BoundingBox bubBoundingBox = new SharpMap.Geometries.BoundingBox(ppntPoint, pntPoint2);//Doing the area to search
lyrMyLayer.DataSource.ExecuteIntersectionQuery(bubBoundingBox, fds);//Seaching the features under the square
if (fds.Tables.Count > 0)//If al least one feature where founded
{
foreach (SharpMap.Data.FeatureDataRow feature in fds.Tables
0)//Getting all the features
{
arlResult.Add(GetInfoFeature(feature)); //Getting all the data from one by one feature, the column name and the value
}
}
}
catch (Exception Ex)
{
return null;
}
return arlResult;
}
/// <summary>
/// This method return all the data of the feature, the column name and the value
/// </summary>
/// <param name="feature">The feature that was founded under the point</param>
/// <returns></returns>
private ArrayList GetInfoFeature(SharpMap.Data.FeatureDataRow feature)
{
ArrayList arlResult = new ArrayList();
try
{
foreach (System.Data.DataColumn ColColumn in feature.Table.Columns)
{
ArrayList arlDataColumn =new ArrayList();//A new array list
arlDataColumn.Add(ColColumn.ColumnName);//The column name
arlDataColumn.Add(feature
ColColumn.ColumnName.ToString()); //The value of the column
arlResult.Add(arlDataColumn); //The data of the column
}
return arlResult;//All the data of the feature
}
catch (Exception Ex)
{
return null;
}
return arlResult;