AutoCAD Map 3D 2009 Geospatial Platform Reference

AutoCAD Map 3D Geospatial Platform API

virtual bool MgFeatureService::TestConnection ( CREFSTRING  providerName,
CREFSTRING  connectionString 
) [pure virtual]

Connects to the Feature Provider specified in the connection string. See Connection To Feature Source .

Remarks:
You use this method to verify that the connection property values are valid. You then use these values to construct a feature source file that you will install in the repository.
.NET Syntax
virtual bool TestConnection(string providerName, string connectionString);
Java Syntax
virtual boolean TestConnection(String providerName, String connectionString);
PHP Syntax
virtual bool TestConnection(string providerName, string connectionString);

Parameters:
providerName (String/string) The name of the Fdo feature provider. Permissible values are obtained by calling the MgFeatureService::GetFeatureProviders Method and looking at the values in the FeatureProviderRegistry/FeatureProvider/Name element.
connectionString (String/string) Connection string for Feature Provider. Connection property names that appear in the connection string as keys can be obtained from the output of GetFeatureProviders method. Look at the FeatureProviderRegistry/FeatureProvider/ConnectionProperties/ConnectionProperty/Name elements.
Returns:
Returns true if the connection was successful; otherwise returns false.
Example (PHP) $boolResult = $featureService->TestConnection("Autodesk.Oracle", "Service=MapGuideService;Username=MapGuideUser;Password=test;DataStore=MapGuide");

Exceptions:
MgFdoException