如何通过xml数据库的选择查询? [英] How to pass select query for xml database?
问题描述
你好,
如何通过xml数据库的选择查询?
我必须创建像这样的应用程序,其中总共有4个列表框.每个列表框都有我使用xml文件排序的信息.现在我想获取列表框选择的所有数据到listview.我也要获取它,但不是所有数据. .
示例:Listbox1具有所有名称,Listbox2具有分隔,Listbox3具有地址,Listbox4具有标记.
当我选择名称时假设"A",则选择"B"之类的地址,选择"C"之类的地址,现在在列表框4中有我选择的那些名称的标记.多个名称可以具有"80.00%"的相同标记.initailly我不想在listbox4中显示任何内容.
选择Listbox1和Listbox2后,Listbox3希望直接在列表视图d中显示所有4个条目,即
名称划分地址标记
如何触发选择查询呢?在xml文件中,我拥有所有数据,并使用DataRow读取它.
列表视图中的预期输出为:
名称部门地址标记
A B C 80.00%
A B C 81.00%
A B C 82.00%
怎么做?我可以只获取第一行的内容.
Hello,
How to pass select query for xml database?
I have to create application like in that have total 4 listbox.Every listbox have information which i have sorted by using xml file.Now i want to fetch all data which is selected by listbox to listview.I also fetch it.but not all data.
Example: Listbox1 have all names ,Listbox2 have division,Listbox3 have address,Listbox4 have marks.
when i select name suppose "A",the select division like "B" ,select address like "C",now in listbox 4 have marks of those name which i select.more than one name can have same marks like "80.00%".initailly i don''t want to show anything in listbox4.
after selecting Listbox1 and Listbox2 ,Listbox3 want to directly show in listview d all 4 entries i.e.
name division Address marks
how to fire select query for it? in xml file i have all data and read it using DataRow.
Expected output in listview as:
name Division Address Marks
A B C 80.00%
A B C 81.00%
A B C 82.00%
how to do it?I jcan just fetch first row not all.
推荐答案
你好,
我找到了如何传递查询的解决方案.
Hello,
I got the solution for how to pass query.
DataRow[] resdtrow;
ds.ReadXml("abc.xml");
resdtrow = ds.Tables["TagData"].Select("Node='" + pstrNode + "' and TagType='" + pstrTagType + "' and Port='" + pstrComPort + "' and NoOfBytes='" + pstrTagSize + "'");
foreach (DataRow dr in resdtrow)
{
view = new ListViewItem(dr[4].ToString());
view.SubItems.Add(dr[5].ToString());
}
这篇关于如何通过xml数据库的选择查询?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!