I got this message on this LINE of CODE :
XmlTextReader XTR = new XmlTextReader("D:\\BOTOLA_MyDocument_Projects\\My Documents\\Visual Studio 2005\\Projects\\cs_XML_World\\WA_XML\\JO.xml"); while (XTR.Read);Error 1 Cannot convert method group 'Read' to non-delegate type 'bool'. Did you intend to invoke the method?
Ryan AlfordPosted May 19, 2008, 3:18 PM
crest dubuaPosted May 19, 2008, 3:10 PM
Ok here is all of the code:
using
System;using
System.Collections.Generic;using
System.ComponentModel;using
System.Data;using
System.Drawing;using
System.Linq;using
System.Text;using
System.Windows.Forms;using
System.Xml;namespace
cs_WA_XML{
public partial class Form1 : Form{
public Form1(){
InitializeComponent();
}
//form1 private void Form1_Load(object sender, EventArgs e){
if (this.B1.Text == Convert.ToString(55) | this.B1.Text == Convert.ToString(55))
B1.Text = Convert.ToString(17);
else
B1.Text =
Convert.ToString(197);}
//load private void B1_Click(object sender, EventArgs e){
int I;
string strNODE;
XmlTextReader XTR = new XmlTextReader("D:\\BOTOLA_MyDocument_Projects\\My Documents\\Visual Studio 2005\\Projects\\cs_XML_World\\WA_XML\\JO.xml");
do
{
if (Convert.ToBoolean(XTR.NodeType== XmlNodeType.Element || XTR.NodeType== XmlNodeType.Text))
for (I = 1; Convert.ToBoolean(XTR.Depth); I++){
strNODE =
"";strNODE = strNODE + XTR.Name + "";
strNODE += XTR.NodeType ;
}
if (XTR.HasValue)
strNODE = strNODE + ": " + XTR.Value;
LB1.Items.Add(strNODE);
}
while (XTR.Read); // ..............//Here is MISTAKE
}
} //class
}
//namespaceHHHHHHHHHHHHHHHELP
crest dubuaPosted May 19, 2008, 3:00 PM
I am about to finish and I only have these last 2 code glitches!
Really.
Ryan AlfordPosted May 19, 2008, 2:59 PM
and to answer your question, try:
while (XTR.Read())