Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DATASET.READXML BUG!

Status
Not open for further replies.

aholloway

Programmer
Joined
Jul 9, 2002
Messages
1
Location
US
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. 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());
}
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top