SqlGeometryDataAdapter.SqlText Property

Gets or sets the SQL query that will be used to select data from a SQL database.

Namespace: DevExpress.Xpf.Map

Assembly: DevExpress.Xpf.Map.v20.2.dll

Declaration

public string SqlText { get; set; }
Public Property SqlText As String

Property Value

Type Description
String

A string value.

Examples

To load shapes from a SQL Geometry datasource, do the following.

  1. Create a SqlGeometryDataAdapter object and assign it to the VectorLayer.Data property.
  2. Specify the SqlGeometryDataAdapter.ConnectionString, SqlGeometryDataAdapter.SpatialDataMember and SqlGeometryDataAdapter.SqlText properties.
NOTE

All table fields of the SQL data table loaded from the database will be provided as attributes values for each SqlGeometryItem object generated by the SqlGeometryDataAdapter.

View Example

Imports System
Imports System.IO
Imports System.Windows

Namespace SqlGeometryDataAdapterExample
    Partial Public Class MainWindow
        Inherits Window

        Private Const dbPath As String = "..\..\..\Data\SQLG.mdf"


        Private connectionString_Renamed As String = "Data Source=(local);AttachDbFileName=" & Path.GetFullPath(Path.Combine(System.Reflection.Assembly.GetEntryAssembly().Location, dbPath)) & ";Database=SqlGeometryDemoDB;Integrated Security=True;MultipleActiveResultSets=True"
        Public ReadOnly Property ConnectionString() As String
            Get
                Return connectionString_Renamed
            End Get
        End Property

        Public Sub New()
            InitializeComponent()
            Me.DataContext = ConnectionString
        End Sub
    End Class
End Namespace
See Also