Предварительно пока так
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load
......
'Populate 'Active Layer' dropdownlist
'********************************************************
If Not Page.IsPostBack Then
Dim func_enum As IEnumerable = Map1.GetFunctionalities()
For Each gisfunctionality As ESRI.ArcGIS.ADF.Web.DataSources.IGISFunctionality In func_enum
Dim gisresource As ESRI.ArcGIS.ADF.Web.DataSources.IGISResource = gisfunctionality.Resource
Dim supported As Boolean = gisresource.SupportsFunctionality(GetType(ESRI.ArcGIS.ADF.Web.DataSources.IQueryFunctionality))
If supported Then
Dim qfunc As ESRI.ArcGIS.ADF.Web.DataSources.IQueryFunctionality
qfunc = CType(gisresource.CreateFunctionality(GetType(ESRI.ArcGIS.ADF.Web.DataSources.IQueryFunctionality), Nothing), ESRI.ArcGIS.ADF.Web.DataSources.IQueryFunctionality)
Dim lids As String()
Dim lnames As String()
qfunc.GetQueryableLayers(Nothing, lids, lnames)
Dim i As Integer
For i = 0 To lnames.Length - 1
ddlActiveLayer.Items.Add(New ListItem(lnames(i), lids(i)))
Next
End If
Next
End If
'********************************************************
End Sub 'Page_Load
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim i As Integer
Dim dataset As System.Data.DataSet = New System.Data.DataSet()
Dim func_enum As IEnumerable = Map1.GetFunctionalities()
For Each gisfunctionality As ESRI.ArcGIS.ADF.Web.DataSources.IGISFunctionality In func_enum
Dim gisresource As ESRI.ArcGIS.ADF.Web.DataSources.IGISResource = gisfunctionality.Resource
Dim supported As Boolean = gisresource.SupportsFunctionality(GetType(ESRI.ArcGIS.ADF.Web.DataSources.IQueryFunctionality))
If supported Then
Dim qfunc As ESRI.ArcGIS.ADF.Web.DataSources.IQueryFunctionality = _
CType(gisresource.CreateFunctionality(GetType(ESRI.ArcGIS.ADF.Web.DataSources.IQueryFunctionality), Nothing), ESRI.ArcGIS.ADF.Web.DataSources.IQueryFunctionality)
Dim layerIDs As String()
Dim layerNames As String()
qfunc.GetQueryableLayers(Nothing, layerIDs, layerNames)
Dim queryFilter As New ESRI.ArcGIS.ADF.Web.QueryFilter
'queryFilter.MaxRecords = 50
For i = 0 To layerIDs.Length - 1
If layerNames(i) = ddlActiveLayer.SelectedItem.Text Then
dataset.Tables.Add(qfunc.Query(Nothing, layerIDs(i), queryFilter))
Exit For
End If
Next
End If
Next gisfunctionality
DataGrid1.DataSource = dataset.Tables(0).DefaultView
DataGrid1.DataBind()
fpAttributeTable.Title = "Таблица данных слоя " + ddlActiveLayer.SelectedItem.Text
fpAttributeTable.Visible = True
End Sub