<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Have you restarted the MapGuide server after changing the database
schema?<br>
Have you tried to create a new FeatureSource?<br>
<pre class="moz-signature" cols="72">Regards, Kenneth Skovhede, GEOGRAF A/S
</pre>
<br>
<br>
padmini godavarthi skrev:
<blockquote cite="mid:1234526751876-2320878.post@n2.nabble.com"
type="cite">
<pre wrap="">Hi,
I attached primary key as "OBJECTID" in my table
then i want to select the line feature based on this objectid.
My code is as follows
-----------------------------
Dim fetresource1 As MgResourceIdentifier = New
MgResourceIdentifier("Library://WaterNetwork/data/resource.FeatureSource")
Dim nameQuery1 As MgFeatureQueryOptions = New
MgFeatureQueryOptions()
nameQuery1.AddFeatureProperty(val1)
nameQuery1.SetFilter("OBJECTID =20")
Dim layer1 As MgLayer = map.GetLayers().GetItem("waterpipe")
Dim value As String = ""
Dim featureReader1 As MgFeatureReader =
featureService.SelectFeatures(fetresource1, layer1.GetFeatureClassName(),
nameQuery1)
While featureReader1.ReadNext()
Dim propertyType As Integer =
featureReader1.GetPropertyType("OBJECTID")
value = GetFeaturePropertyValue(featureReader1, "OBJECTID")
End While
Dim selection As MgSelection = New MgSelection(map)
selection.AddFeatures(layer1, featureReader1, 0)
Dim selectXML As String = selection.ToXml()
selection.Save(resourceService, "watermap")
Page.ClientScript.RegisterStartupScript(Page.GetType(), "test",
"select('" & selectXML & "')", True)
map.Save(resourceService)
featureReader1.Close()
then after executing this code non of the line was selected.
Has any idea on it?
Thanks and Regards,
Padmini.
Kenneth Skovhede, GEOGRAF A/S wrote:
</pre>
<blockquote type="cite">
<pre wrap="">This is what I found from a quick search:
<a class="moz-txt-link-freetext" href="http://www.techonthenet.com/oracle/primary_keys.php">http://www.techonthenet.com/oracle/primary_keys.php</a>
Regards, Kenneth Skovhede, GEOGRAF A/S
padmini godavarthi skrev:
</pre>
<blockquote type="cite">
<pre wrap="">Hi,
is selection is done based on primary key of type integer?
Then in my table there is no primary key column.How can i achieve thin?
Thanks and Regards,
Padmini.
Kenneth Skovhede, GEOGRAF A/S wrote:
</pre>
<blockquote type="cite">
<pre wrap="">It is not enough that it has unique values, there must be a primary key
defined.
Since you are using Oracle, the key must be defined on the Oracle table.
IIRC, the primary key must also be of type integer.
Regards, Kenneth Skovhede, GEOGRAF A/S
padmini godavarthi skrev:
</pre>
<blockquote type="cite">
<pre wrap="">Hi,
In my table STARTVALVE has unique valves .By using that "STARTVALVE"
property iam trying for selection .
Regards,
Padmini.
Kenneth Skovhede, GEOGRAF A/S wrote:
</pre>
<blockquote type="cite">
<pre wrap="">You cannot use selection if the table does not have unique primary
keys.
Regards, Kenneth Skovhede, GEOGRAF A/S
padmini godavarthi skrev:
</pre>
<blockquote type="cite">
<pre wrap="">Hi,
In my table iam not having any primary key columns.
Thanks and Regards,
Padmini
Kenneth Skovhede, GEOGRAF A/S wrote:
</pre>
<blockquote type="cite">
<pre wrap="">I think your data has broken primary keys (eg. empty strings as
primary
key).
Regards, Kenneth Skovhede, GEOGRAF A/S
padmini godavarthi skrev:
</pre>
<blockquote type="cite">
<pre wrap=""> Hi,
iam using Mapguide opensource 2.0 (with .net 2.0 +IIS 5.1)
Now iam struck up with high lighting line features on the map.
my code is as follows:-
-------------------------------
Dim fetresource1 As MgResourceIdentifier = New
MgResourceIdentifier("Library://WaterNetwork/data/resource.FeatureSource")
Dim nameQuery1 As MgFeatureQueryOptions = New
MgFeatureQueryOptions()
Dim val1 As String = "STARTVALVE"
nameQuery1.AddFeatureProperty(val1)
nameQuery1.SetFilter("STARTVALVE ='124'")
Dim layer1 As MgLayer =
map.GetLayers().GetItem("waterpipe")
layer1.Selectable = True
Dim featureReader1 As MgFeatureReader =
featureService.SelectFeatures(fetresource1,
layer1.GetFeatureClassName(),
nameQuery1)
Dim selection As MgSelection = New MgSelection(map)
selection.AddFeatures(layer1, featureReader1, 0)
Dim selectXML As String = selection.ToXml()
selection.Save(resourceService, "watermap")
Page.ClientScript.RegisterStartupScript(Page.GetType(),
"test",
"select('" & selectXML & "')", True)
map.Save(resourceService)
featureReader1.Close()
-------------------------------------------------------------------------------------------------
function select(val) {
var selectionXML = val;
parent.parent.SetSelectionXML(selectionXML);
alert("Selected");
parent.parent.refresh;
}
but the line feature is not highlighting ? but this code works
with
polygon feature.
i found that in xml
<?xml version="1.0" encoding="UTF-8"?><FeatureSet
xmlns:xsi=<a class="moz-txt-link-rfc2396E" href="http://www.w3.org/2001/XMLSchema-instance">"http://www.w3.org/2001/XMLSchema-instance"</a>
xsi:noNamespaceSchemaLocation="FeatureSet-1.0.0.xsd"> <Layer
id="1f6baf1e-0000-1000-8000-0016e692a356"> <Class
id="KingOra:IMCN~GIS_WATERPIPE_DETAILS~SHAPE"> <ID></ID>
<ID></ID>
</Class> </Layer></FeatureSet>
ID doesn't came.is there problem with ID?
Can u plz tell me the solution?
Thanks and Regards,
Padmini
</pre>
</blockquote>
<pre wrap="">_______________________________________________
mapguide-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:mapguide-users@lists.osgeo.org">mapguide-users@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/mapguide-users">http://lists.osgeo.org/mailman/listinfo/mapguide-users</a>
</pre>
</blockquote>
<pre wrap="">
</pre>
</blockquote>
<pre wrap="">_______________________________________________
mapguide-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:mapguide-users@lists.osgeo.org">mapguide-users@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/mapguide-users">http://lists.osgeo.org/mailman/listinfo/mapguide-users</a>
</pre>
</blockquote>
<pre wrap="">
</pre>
</blockquote>
<pre wrap="">_______________________________________________
mapguide-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:mapguide-users@lists.osgeo.org">mapguide-users@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/mapguide-users">http://lists.osgeo.org/mailman/listinfo/mapguide-users</a>
</pre>
</blockquote>
<pre wrap="">
</pre>
</blockquote>
<pre wrap="">_______________________________________________
mapguide-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:mapguide-users@lists.osgeo.org">mapguide-users@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/mapguide-users">http://lists.osgeo.org/mailman/listinfo/mapguide-users</a>
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
</blockquote>
</body>
</html>