Go Back   CodingForums.com > :: Server side development > ASP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 04-06-2011, 11:10 PM   PM User | #1
NKeuxmuis
New Coder

 
Join Date: Feb 2011
Posts: 23
Thanks: 4
Thanked 0 Times in 0 Posts
NKeuxmuis is an unknown quantity at this point
How do I declare XDocument

I have a website which is not working because of the following line of code Dim xmlDS = XDocument.Load(Server.MapPath("~/dating_database.xml"))

The compiler basically says I need to declare XDocument but I have no idea how to do that. I have looked on the vb.net web page for any help but nothing works. Can anyone tell me how to declare XDocument in the following code so that I can overcome this error


Code:
Partial Class _Default
    
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load


    End Sub

    Protected Sub btnSearch_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSearch.Click

        Dim xmlDS = XDocument.Load(Server.MapPath("~/dating_database.xml"))
        Dim clients = From client In xmlDS...<client> _
                      Where client.<body_type>.Value Like "*" & lstBodyType.SelectedValue And _
                      client.<sex>.Value Like "*" & lstSex.SelectedValue _
                      Select client

        Dim buffer As String = "<table>"
        buffer &= "<tr>"
        buffer &= String.Format("<th>{0}</th>", "Name")
        buffer &= String.Format("<th>{0}</th>", "Sex")
NKeuxmuis is offline   Reply With Quote
Reply

Bookmarks

Tags
declaration, declare, vb.net, xdocument, xml

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:57 AM.


Advertisement
Log in to turn off these ads.