Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8871899
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:05:56+00:00 2026-06-14T18:05:56+00:00

I have been playing with XML in VB.net which is rather different from the

  • 0

I have been playing with XML in VB.net which is rather different from the way you do it in C#,
it seams more natural to traverse nodes. Then, you come across namespaces.

First of all, I used the imports like:

Imports <xmlns:mstns="http://tempuri.org/myDataSet.xsd">
Imports <xmlns="http://tempuri.org/MyDataSet.xsd">
Imports <xmlns:xs="http://www.w3.org/2001/XMLSchema">
Imports <xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
Imports <xmlns:msprop="urn:schemas-microsoft-com:xml-msprop">

and then I tried to access the TableAdapter nodes like this:

  Dim doc As XDocument

  Dim tableAdapters As XElement

  doc = XDocument.Load(file.FullName)

 tableAdapters = (From item As XElement In doc.<xs:schema>.
                                               <xs:annotation>.
                                               <xs:appinfo>.
                                               <DataSource>. 
                                               <Tables>.
                                               <TableAdapter>
                                               Select item).FirstOrDefault()

[Ignore the line breaks, I did it only for readability]

I can get the nodes correctly until xs:appinfo, after that, any node I attempt to retrieve is null

what am I doing wrong?

Below is the normal xml structure of a dataset:

XML structure of a normal dataset

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T18:05:57+00:00Added an answer on June 14, 2026 at 6:05 pm

    never mind, I already found the problem. The DataSource node was not using a prefix namespace but it was actually using a namespace AS AN ATTRIBUTE after all. You can see that in the image (as xmlns).

    So to solve it, you do like this:

    add another imports with the namespace of xmlns found as attribute in the node:

    Imports <xmlns:datasource="urn:schemas-microsoft-com:xml-msdatasource">
    

    then retrieve like this:

            tableAdapters = (From item As XElement In doc.<xs:schema>.
                                                         <xs:annotation>.
                                                         <xs:appinfo>.
                                                          <datasource:DataSource>.
                                                        <datasource:Tables>.
                                                        <datasource:TableAdapter> 
                              Select item).FirstOrDefault()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been playing with jstree (1.0rc2)+jquery (1.4.2) for the first time with c#.net
I have been playing with XML and PHP, I have googled to get the
I've been playing about with XStream XML parsing and I have a bit of
I have been playing with ASP.NET Web API. I am looking to see can
I have been playing with NodeJS lately and i found myself stuck with a
I have been playing with Yii for a couple of months now, and to
I have been playing with Expect/TCL today and I was hoping someone can tell
I have been playing around with Google Apps Script today and I am trying
I have been playing around a bit with a fairly simple, home-made search engine,
I have been playing around with the MVP pattern using winforms for the last

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.