Why is it that when I want to use an attribute like for instance:
.WriteAttribute String("WaiterI d", "14")
and later on (in another application) want to bind the xml to a
datagrid with readxml I'm not getting any records (just one row with
14 in it..)
If I ommit the attribute it works just fine?
What am I doing wrong here, have to admit I'm more or less discovering
xml..
Thanks in advance,
Mike
[Code snippet which writes the XML (Compact Framework)]
pXTWWriter = New XmlTextWriter(i FileName,
System.Text.Enc oding.Default)
'WRITE THE ROOT TAG
.WriteStartElem ent("Table")
.WriteAttribute String("WaiterI d", "14")
'ADD THE DRINKS FIRST
.WriteStartElem ent("Order")
.WriteStartElem ent("Type")
.WriteString("D rinks")
.WriteEndElemen t()
.WriteStartElem ent("Item")
.WriteString("H eineken")
.WriteEndElemen t()
.WriteStartElem ent("Qty")
.WriteString("2 ")
.WriteEndElemen t()
.WriteEndElemen t()
Etc,etc
[Code snippet which reads the XML (Desktop App.]
Dim fs As New FileStream("ord er.xml", FileMode.Open)
Dim xr As New XmlTextReader(f s)
xr.WhitespaceHa ndling = WhitespaceHandl ing.None
OrderDS = New DataSet
OrderDS.ReadXml (xr)
statusBar.Text = "Loaded XML data"
xr.Close()
fs.Close()
Dim SourceTable As DataTable
SourceTable = OrderDS.Tables( 0)
dgOrder.DataSou rce = SourceTable
.WriteAttribute String("WaiterI d", "14")
and later on (in another application) want to bind the xml to a
datagrid with readxml I'm not getting any records (just one row with
14 in it..)
If I ommit the attribute it works just fine?
What am I doing wrong here, have to admit I'm more or less discovering
xml..
Thanks in advance,
Mike
[Code snippet which writes the XML (Compact Framework)]
pXTWWriter = New XmlTextWriter(i FileName,
System.Text.Enc oding.Default)
'WRITE THE ROOT TAG
.WriteStartElem ent("Table")
.WriteAttribute String("WaiterI d", "14")
'ADD THE DRINKS FIRST
.WriteStartElem ent("Order")
.WriteStartElem ent("Type")
.WriteString("D rinks")
.WriteEndElemen t()
.WriteStartElem ent("Item")
.WriteString("H eineken")
.WriteEndElemen t()
.WriteStartElem ent("Qty")
.WriteString("2 ")
.WriteEndElemen t()
.WriteEndElemen t()
Etc,etc
[Code snippet which reads the XML (Desktop App.]
Dim fs As New FileStream("ord er.xml", FileMode.Open)
Dim xr As New XmlTextReader(f s)
xr.WhitespaceHa ndling = WhitespaceHandl ing.None
OrderDS = New DataSet
OrderDS.ReadXml (xr)
statusBar.Text = "Loaded XML data"
xr.Close()
fs.Close()
Dim SourceTable As DataTable
SourceTable = OrderDS.Tables( 0)
dgOrder.DataSou rce = SourceTable
Comment