Reading xml file into dataset using asp.net vb
If you want to read from and xml file in asp.net vb and the bind that data to a dataset, simply use the below code:
' Read the xml from file, make sure to change the path and file name
dataset1.ReadXml(Server.MapPath("~/directory/xml_file_name.xml"))
' Bind the data from the xml to a dataset and to a datagrid
datagrid1.DataMember = "file"
datagrid1.DataSource = dataset1
datagrid1.DataBind()
Where you see "file" mentioned about, be sure to change this to the section you want to read from the xml file.
Send a link to this page via email