Hi,
how can i returned data from xml file based on two conditions?
Currently it will bind all the data from xml file to my dropdownlist.
Public Sub member_group()
Dim DS As New DataSet()
DS.ReadXml(Server.MapPath("~/App_Data/Member-group.xml"))
Dim DR As DataRow() = DS.Tables(0).Select("merchantID = '70001' AND status = 'Active'")
DS.AcceptChanges()
Dim DV As DataView = DS.Tables("Details").DefaultView
DV.Sort = "priority"
Me.ddl_group.DataTextField = "name"
Me.ddl_group.DataValueField = "name"
Me.ddl_group.DataSource = DV
Me.ddl_group.DataBind()
End Sub
XML File
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<Setting>
<Details>
<ID>48374</ID>
<merchantID>70001</merchantID>
<name>Beginner</name>
<group>Percentage</group>
<rate>0</rate>
<priority>01</priority>
<status>Active</status>
</Details>
<Details>
<ID>43402</ID>
<merchantID>70001</merchantID>
<name>Professional</name>
<group>Percentage</group>
<rate>0</rate>
<priority>01</priority>
<status>Disabled</status>
</Details>
<Details>
<ID>51374</ID>
<merchantID>70002</merchantID>
<name>Member</name>
<group>Percentage</group>
<rate>0</rate>
<priority>01</priority>
<status>Active</status>
</Details>
</Setting>