Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. XML / XSL
  4. Some elements not showing any values [modified]

Some elements not showing any values [modified]

Scheduled Pinned Locked Moved XML / XSL
databasexmlsql-serversysadminquestion
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    Ekjon
    wrote on last edited by
    #1

    Hello, I was trying to load data from xml files to SQL Server tables. I am using XMLTextReader to read from the files. my code's working and loading information to two tables. Except, few fields. They show no values when read - even though the file contains values for them. I notice all of them are either unsignedByte or unsignedInt type in the xml schema. I changed them to strings just to test, but it's doing the same. I think the datatype is not making any difference, but these elements don't have any attributes and the values are directly in the tags. So, could be I'm missing something. Here's part of my code:

    while (reader.Read())
    {
    switch (reader.NodeType)
    {
    case XmlNodeType.Element:
    if (reader.Name.ToLower().Equals("decimals"))
    {
    dec = reader.Value;
    }
    .....
    break;
    case XmlNodeType.Text:
    ...nothing
    break;
    case XmlNodeType.EndElement:
    break;
    }
    }

    Any idea, what's wrong? Thanks.

    modified on Monday, August 11, 2008 4:42 PM

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups