I am getting the following error:
Bad Network Data; terminating connection
in the Communication App Inspector panel. I am calling a function in a dll where the code is shown below. Basically i get the error when i return the XmlDocument but if i return it as a string then it works fine. Any ideas as to why this is occuring?
code
===============
using System;
using System.Data;
using System.Data.SqlClient;
using System.Xml;
using FlashGateway.IO;
namespace FRDG
{
public class SelectFromDatabase
{
public XmlDocument SelectEvents()
{
SqlConnection mySqlConnection = new SqlConnection(myConnection);
SqlCommand mySqlCommand = new SqlCommand("select * from test FOR XML AUTO, XMLDATA", mySqlConnection);
mySqlCommand.CommandTimeout = 30;
mySqlConnection.Open();
DataSet myDataSet1 = new DataSet();
myDataSet1.ReadXml(mySqlCommand.ExecuteXmlReader(),XmlReadMode.Fragment);
//String myString = myDataSet1.GetXml();
XmlDocument datadoc = new XmlDocument();
datadoc.LoadXml(myDataSet1.GetXml());
mySqlConnection.Close();
return datadoc;
}
}
}