<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
So you are using JScript .Net?<br>
<br>
In that case you might have to typecast it:<br>
<pre wrap="">var featureService = (MgFeatureService)siteConnection.CreateService(MgServiceType.FeatureService);</pre>
Not completely familiar with JScript.Net, but the error seems to
indicate that the object (featureService) is of type MgService.<br>
MgService is a base class, and also the signature return type for
CreateService. <br>
The actual type of the object returned is MgFeatureService.<br>
<pre class="moz-signature" cols="72">Regards, Kenneth Skovhede, GEOGRAF A/S
</pre>
<br>
<br>
Marius_360 skrev:
<blockquote cite="mid:18528370.post@talk.nabble.com" type="cite">
<pre wrap="">This is exactly how I had it from the beginning, but it gives me “Objects of
type 'OSGeo.MapGuide.MgService' do not have such a
member” error
Carl Jokl wrote:
</pre>
<blockquote type="cite">
<pre wrap="">I will assume this must be JScript .Net because what you are doing could
not work at all otherwise but I see the problem in the code:
var featureService = new MgFeatureService(); //You explicity create a new
feature service. This is wrong
//This method call retrieves the feature service from the site connection
but you are not storing the //returned value
siteConnection.CreateService(MgServiceType.FeatureService);
//This will not work because you explicity created this feature service
instead of getting it from the feature ///service
featureService.CreateFeatureSource(resourceIdentifier, sdfParams)
I am not completely familiar with JScript .Net but I would think that this
should be
//Get the feature service from the site connection, don't create it
explicity.
var featureService =
siteConnection.CreateService(MgServiceType.FeatureService);
//Assuming you correctly created the resource identifier and the sdf
params elsewhere this should work
if (featureService) //Checking the returned feature service was not null
just in case.
{
featureService.CreateFeatureSource(resourceIdentifier, sdfParams);
}
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
</blockquote>
</body>
</html>