Hi I am feeling a bit lost and confused with XML. I am trying to build a very simple web app that will get its data from an XML file which has been created from a SQL server. The application allows the user to hold a contact details on there laptops in a disconnected
environment. They only need to be able to read the data and no editing or inputting is required. So I build an XML file using ado.net, I would like the user to be able to query the xml file via a textbox. So if the user types in 'Sam' it will go away and pull
out all Contacts with the first name Sam and fill a datagrid with teh results. However I am a bit confused on how I query a XML file also do I have to put it in a dataset before I can fill a datagrid? I briefly heard that I should be using XPath, XQuery or
something like XSL. I have never really used XML, all I want to do is pass it one parameter. My code looks like teh below: Dim dsWards As New DataSet() dsWards.ReadXml(Server.MapPath("Contacts.xml")) DataGrid1.DataSource = dsWards DataGrid1.DataBind() I would
be grateful for some simle examples that I could have a look at in VB.Net. Also I am using Visual Studio .Net 2003, does this come with any tools that will help me query an XML file? I just feel a bit lost and cant find any good examples PS All the users will
have IIS running on their machines
One key ideas in loading XML file to dataset is that you can then access the data in relational ways. Without seeing your XML it is hard to say what kind of structure it has done in the DataSet whebn XML is loaded, but you generally could filter the DataSet
without using XSLT and Xpath. Especially if you want to bind the results. You could do so as you do with normal DataSet & DataTable and DataView that get from DataTable's (the one that represents Contacts table in your DataSet) DefaultView that return the
DataView and specify filetering expression for it's RowFilter property (the filter expressions is like WHERE condition in SQL ie. FirstName LIKE '%Sam%'. If you want more exact answer, please provide some more details.
BigMeat
Participant
757 Points
294 Posts
XML, im feeling a bit lost
Aug 02, 2003 09:29 AM|LINK
joteke
All-Star
46284 Points
6896 Posts
ASPInsiders
MVP
Re: XML, im feeling a bit lost
Aug 02, 2003 01:31 PM|LINK
Teemu Keiski
Finland, EU