SqlGeography.InstanceOf 方法

Tests if the SqlGeography instance is the same as the specified type.

命名空间:  Microsoft.SqlServer.Types
程序集:  Microsoft.SqlServer.Types(在 Microsoft.SqlServer.Types.dll 中)

语法

声明
<SqlMethodAttribute(IsDeterministic := True, IsPrecise := True)> _
Public Function InstanceOf ( _
    geometryType As String _
) As SqlBoolean
用法
Dim instance As SqlGeography 
Dim geometryType As String 
Dim returnValue As SqlBoolean 

returnValue = instance.InstanceOf(geometryType)
[SqlMethodAttribute(IsDeterministic = true, IsPrecise = true)]
public SqlBoolean InstanceOf(
    string geometryType
)
[SqlMethodAttribute(IsDeterministic = true, IsPrecise = true)]
public:
SqlBoolean InstanceOf(
    String^ geometryType
)
[<SqlMethodAttribute(IsDeterministic = true, IsPrecise = true)>]
member InstanceOf : 
        geometryType:string -> SqlBoolean
public function InstanceOf(
    geometryType : String
) : SqlBoolean

参数

  • geometryType
    类型:System.String
    A string that specifies one of the 12 types exposed in the geography type hierarchy.

返回值

类型:System.Data.SqlTypes.SqlBoolean
A SqlBoolean value that indicates whether the SqlGeography instance is the same as the specified geometry type.Returns true if the type of a geography instance is the same as the specified type, or if the specified type is an ancestor of the instance type; otherwise, returns false.

注释

The input for the method must be one of the following: T:Microsoft.SqlServer.Types.SqlGeometry, Point, Curve, LineString, Surface, Polygon, GeometryCollection, MultiSurface, MultiPolygon, MultiCurve, MultiLineString, and MultiPoint.

This method throws an ArgumentException if any other strings are used for the input.

请参阅

参考

SqlGeography 类

Microsoft.SqlServer.Types 命名空间