[mapserver-users] select one column values from a table

Paolo Corti pcorti at gmail.com
Tue May 19 04:27:44 EDT 2009




meenu wrote:
> 
> dears,in a mapserver website how can i retrve one column details from a
> table....for eg in my map i have one table called n_123 ...in this table i
> have one column named "PLO_900"...i need to retrive value like as follows
> "select PLO_900 from  n_123 "...i did the coding like as follows...but it
> is giving me the table field names...can anybody help me to solve this
> issue?
>       
>        Dim layer As layerObj = Util.MSMap.getLayerByName("n_123 ")
>         If layer IsNot Nothing Then
>             layer.open()
>             For i As Integer = 0 To layer.numitems - 1
>                 Me.CmbS.Items.Add(layer.getItem(i))
>             Next
>             layer.close()
> 

In c# this code is accessing a feature's values:

String results = "";
layerObj layer = map.getLayerByName("mylayer");
layer.open();
shapeObj shape=layer.getFeature(shapeInd, -1);
//iterate fields and getting values
for(int i=0; i<layer.numitems; i++)
{
  results += "<BR>" + layer.getItem(i) + "=" + shape.getValue(i);
}
layer.close();

let me know if it works for you
best regards

Paolo




-- 
View this message in context: http://n2.nabble.com/select-one-column-values-from-a-table-tp2931342p2938255.html
Sent from the Mapserver - User mailing list archive at Nabble.com.



More information about the mapserver-users mailing list