Some elements not showing any values [modified]
-
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