I looked on MSDN for LINQ which I'm new to... used this code as an
event for a button, but the compiler didn't like any of this:
Public Sub XLinq25()
Dim doc = XDocument.Load(Server.MapPath("history.xml"))
Dim query = _
From c In doc.<Root>.<Customers> _
Where c.<Topic>.<Year>.Value = "1963" _
Select c
For Each result In query
Console.WriteLine(result)
Next
End Sub
On Dec 15, 12:12 pm, "Brandon Betances" <[email protected]> wrote:
> LINQ to XML, get the record ID you want, pass it as a query string
>
>
>
> On Mon, Dec 15, 2008 at 12:08 PM, Brock <[email protected]> wrote:
>
> > I have an .aspx page that is successfully (I use Visual Web Developer
> > 2008) reading an XML file and displaying the records on a datagrid
> > using:
>
> > <script runat="server">
> > Private Function MakeDataView() as DataView
> > Dim myDataSet As New DataSet()
> > myDataSet.ReadXml(Server.MapPath("history.xml"))
> > Dim view As DataView = New DataView(myDataSet.Tables(0))
> > view.AllowDelete = False
> > view.AllowEdit = False
> > view.AllowNew = False
> > Return view
> > End Function
>
> > Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
> > Dim view as DataView = MakeDataView()
> > dgHistory.DataSource = view
> > dgHistory.AllowSorting = True
> > dgHistory.DataBind()
> > Label1.Text = DateAndTime.Now.ToLongTimeString
> > End Sub
> > </script>
>
> > Can anyone give me some clues as to how to code another .aspx page to
> > query the XML using XPathNavigator (or something else) tools to find a
> > specific node
> > based on an ID number? The goal is to have the user be able to click
> > on an edit button and it will launch an edit page passing that record
> > to the edit page.
>
> > I really need a separate edit page because the number of fields is
> > over 50 and the datagrid in the base form only displays about 4
> > fields.- Hide quoted text -
>
> - Show quoted text -