DATASET.READXML BUG!

I tried three of the DataSet's overloaded ReadXml Methods (stream,string, and XmlTextReader). They all failed to populate my DataSet. Try it yourself and let me know if it works for you. If you get it to work email me at aholloway@automark.net. I have attached the code below. Thanks!

private void mnuFile_Load_Click(object sender, System.EventArgs e)
{
try
{
if (cdOpenFile.ShowDialog() == DialogResult.OK)
{
/*XmlTextReader objXmlRdr = new XmlTextReader(cdOpenFile.OpenFile());
while(objXmlRdr.Read())
{
MessageBox.Show(objXmlRdr.Value);
}
*/
//objDs.ReadXml(new XmlTextReader(cdOpenFile.OpenFile()),XmlReadMode.IgnoreSchema);
//objDs.ReadXml(cdOpenFile.OpenFile(),XmlReadMode.IgnoreSchema);
objDs.ReadXml("C:\xml\inbox.xml",XmlReadMode.IgnoreSchema);
MessageBox.Show(objDs.GetXml());
/*DataTable myDt = objDs.Tables[0];
foreach (DataRow r in myDt.Rows)
MessageBox.Show(r[0].ToString());
*/
}
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories