簡體   English   中英

SQL CLR地理類型

[英]SQL CLR Geography Type

這可能完全偏離基礎 - 但由於某種原因,我不能在SQL CLR函數(VB.NET)中聲明SqlGeography類型的變量。 以下說明SqlGeography沒有在第3行定義 - 很確定我需要導入一些東西 - 但是找不到它。

哦是的 - 使用SSDT。

任何幫助贊賞。

Public Shared Sub usp_routing_dijkstra(node_1 As SqlGuid, node_2 As SqlGuid)

    Dim StartGeo As SqlGeography

    Using connection As New SqlConnection("context connection=true")
        connection.Open()

        Using command As New SqlCommand("select [geo] from [nodes] where [sys_id] = @id", connection)
            Dim param As New SqlParameter("@id", SqlDbType.UniqueIdentifier)
            param.Value = node_1
            command.Parameters.Add(param)
            Dim StartNode As Object
            StartNode = command.ExecuteScalar()
            If StartNode IsNot Nothing Then

            End If
        End Using

    End Using

End Sub

嘗試在項目中添加對Microsoft.SqlServer.Types的引用。 在我的例子中,它位於C:\\ Program Files(x86)\\ Microsoft SQL Server \\ 110 \\ SDK \\ Assemblies \\ Microsoft.SqlServer.Types.dll。

然后,確保在.vb文件的頂部有以下Imports:Imports Microsoft.SqlServer Imports Microsoft.SqlServer.Types

之后,您應該能夠聲明SqlGeography類型的變量。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM