[VB.NET]VB.NET+MAPX查询问题
来源:互联网 发布:行助手是什么软件 编辑:程序博客网 时间:2024/06/07 01:47
<script type="text/javascript"><!--google_ad_client = "pub-8333940862668978";/* 728x90, 创建于 08-11-30 */google_ad_slot = "4485230109";google_ad_width = 728;google_ad_height = 90;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
VB.NET+MAPX查询问题
Dim FindObj As MapXLib.Find
Dim FoundFeature As MapXLib.FindFeature
''从要查询的RTU图层生成Find对象,并为这个对象设置要查询的FindDataSet、FindField属性
FindObj = AxMap1.Layers.Item(1).Find
FindObj.FindDataset = AxMap1.DataSets(Me.ComboBox2.Text & "dataset ") ''( "RTU节点 " & " dataset ")
FindObj.FindField = FindObj.FindDataset.Fields(Me.ComboBox2.Text) ''( "RTUName ")
FoundFeature = FindObj.Search(ComboBox1.Text)
Me.Hide()
'' 关掉AutoRedraw是因为CenterX(Y)的改变就要刷新图层,AutoRedraw打开的话会造成二次刷新
AxMap1.AutoRedraw = False
Me.Show()
--------------------------------------------
编译通过后
Me.ComboBox2.Text 中输入图层名
ComboBox1.Text中输入内容
“FindObj.FindDataset = AxMap1.DataSets(Me.ComboBox2.Text & "dataset ")”这行总是提示 “No object was found using the index you specified.”
请问是怎么了?
__________________________________________________________________________
没人知道吗?
__________________________________________________________________________
谁知道告诉小弟啊
__________________________________________________________________________
AxMap1.DataSets之前add过么?
你的代码有问题,觉得你至少也要写成axmap1.datasets.item()什么的吧?
__________________________________________________________________________
所有代码是:
Dim lyR As MapXLib.Layer
Dim findobj As MapXLib.Find
Dim findStr As String
Dim i As Short
Dim fdat As MapXLib.FindFeature
Dim layerds As MapXLib.Dataset
Dim fid As MapXLib.Field
On Error Resume Next
TreeView1.Nodes.Clear()
Dim result As Integer
''数据绑定
For Each lyR In AxMap1.Layers
AxMap1.DataSets.Add(MapXLib.DatasetTypeConstants.miDataSetLayer, lyR, lyR.Name)
Next lyR
findStr = TextBox1.Text.Trim ''输入查询目标 "
Dim X As MapXLib.Field ''Field查询字段,和find.DataSets属性一起使用
For i = 1 To AxMap1.Layers.Count ''查询每一层
findobj = AxMap1.Layers(i).Find ''查找的对象是第*层
layerds = AxMap1.DataSets.Item(AxMap1.Layers(i).Name) ''查询数据集Item(列名)
findobj.FindDataset = Me.AxMap1.DataSets(AxMap1.Layers(i).Name) ''FindDataset查询数据集
For Each fid In layerds.Fields
findobj.FindField = findobj.FindDataset.Fields(fid) ''Field查询字段
fdat = findobj.Search(findStr)
''AxMap1.CenterX = fdat.CenterX
''AxMap1.CenterY = fdat.CenterY
AxMap1.Layers(i).Selection.se.Replace(fdat) ''添加网格表示选取(高亮)
'' AxMap1.Layers(i).ClearSelection()
Next fid
Next
''If fdat = " " Then MsgBox( "没有找到任何数据! ", , "提示 ")
''AxMap1.AutoRedraw = False '' (禁止自动刷新)
Me.AxMap1.DataSets.RemoveAll()
--------------------------------------------
编译通过后
Me.ComboBox2.Text 中输入图层名
ComboBox1.Text中输入内容
“FindObj.FindDataset = AxMap1.DataSets(Me.ComboBox2.Text & "dataset ")”这行总是提示 “No object was found using the index you specified.”
请问是怎么了?
__________________________________________________________________________
VB.NET+MAPX查询问题
Dim FindObj As MapXLib.Find
Dim FoundFeature As MapXLib.FindFeature
''从要查询的RTU图层生成Find对象,并为这个对象设置要查询的FindDataSet、FindField属性
FindObj = AxMap1.Layers.Item(1).Find
FindObj.FindDataset = AxMap1.DataSets(Me.ComboBox2.Text & "dataset ") ''( "RTU节点 " & " dataset ")
FindObj.FindField = FindObj.FindDataset.Fields(Me.ComboBox2.Text) ''( "RTUName ")
FoundFeature = FindObj.Search(ComboBox1.Text)
Me.Hide()
'' 关掉AutoRedraw是因为CenterX(Y)的改变就要刷新图层,AutoRedraw打开的话会造成二次刷新
AxMap1.AutoRedraw = False
Me.Show()
--------------------------------------------
编译通过后
Me.ComboBox2.Text 中输入图层名
ComboBox1.Text中输入内容
“FindObj.FindDataset = AxMap1.DataSets(Me.ComboBox2.Text & "dataset ")”这行总是提示 “No object was found using the index you specified.”
请问是怎么了?
__________________________________________________________________________
没人知道吗?
__________________________________________________________________________
谁知道告诉小弟啊
__________________________________________________________________________
AxMap1.DataSets之前add过么?
你的代码有问题,觉得你至少也要写成axmap1.datasets.item()什么的吧?
__________________________________________________________________________
所有代码是:
Dim lyR As MapXLib.Layer
Dim findobj As MapXLib.Find
Dim findStr As String
Dim i As Short
Dim fdat As MapXLib.FindFeature
Dim layerds As MapXLib.Dataset
Dim fid As MapXLib.Field
On Error Resume Next
TreeView1.Nodes.Clear()
Dim result As Integer
''数据绑定
For Each lyR In AxMap1.Layers
AxMap1.DataSets.Add(MapXLib.DatasetTypeConstants.miDataSetLayer, lyR, lyR.Name)
Next lyR
findStr = TextBox1.Text.Trim ''输入查询目标 "
Dim X As MapXLib.Field ''Field查询字段,和find.DataSets属性一起使用
For i = 1 To AxMap1.Layers.Count ''查询每一层
findobj = AxMap1.Layers(i).Find ''查找的对象是第*层
layerds = AxMap1.DataSets.Item(AxMap1.Layers(i).Name) ''查询数据集Item(列名)
findobj.FindDataset = Me.AxMap1.DataSets(AxMap1.Layers(i).Name) ''FindDataset查询数据集
For Each fid In layerds.Fields
findobj.FindField = findobj.FindDataset.Fields(fid) ''Field查询字段
fdat = findobj.Search(findStr)
''AxMap1.CenterX = fdat.CenterX
''AxMap1.CenterY = fdat.CenterY
AxMap1.Layers(i).Selection.se.Replace(fdat) ''添加网格表示选取(高亮)
'' AxMap1.Layers(i).ClearSelection()
Next fid
Next
''If fdat = " " Then MsgBox( "没有找到任何数据! ", , "提示 ")
''AxMap1.AutoRedraw = False '' (禁止自动刷新)
Me.AxMap1.DataSets.RemoveAll()
--------------------------------------------
编译通过后
Me.ComboBox2.Text 中输入图层名
ComboBox1.Text中输入内容
“FindObj.FindDataset = AxMap1.DataSets(Me.ComboBox2.Text & "dataset ")”这行总是提示 “No object was found using the index you specified.”
请问是怎么了?
__________________________________________________________________________
- [VB.NET]VB.NET+MAPX查询问题
- VB.NET+Mapx 创建新图层
- [VB.NET]请教:数据库逆向查询问题
- [VB.NET]VB.net中的DoEvents()问题
- [VB.NET]vb.net中 listbox 问题
- [VB.NET]vb.net update 方面问题...
- Vb.Net问题集
- [VB.NET]datagridview问题
- [VB.NET]datagridview 问题
- [VB.NET]listview问题
- [VB.NET]OpenFileDialog问题
- [VB.NET]datgridview问题
- [VB.NET].NET2005问题
- [VB.NET]excel 问题
- vb.net 注意问题
- 未平滑等值线的生成(VB.NET+MAPX)
- 等值线的生成(平滑)(MAPX+VB.net)
- [VB.NET] 文件查询系统
- [VB.NET]图形旋转的问题?
- [VB.NET]vb.net实现搜索??
- 选购ERP软件时需避免的五大错误
- 用微软Sandcastle创建.NET文档
- [VB.NET]Crystal Report
- [VB.NET]VB.NET+MAPX查询问题
- 想哭...黑想黑想...
- 遍历Request.ServerVariables
- Java编程那些事儿29—表达式
- [VB.NET]vb.net中怎样删除Datagrid中的数据
- SQL 注入式攻击的终极防范
- [VB.NET]BindingNavigator为什么不能活动?
- 常用JS
- [VB.NET]在vb.net中如何获取sql数据库中表的字段数?