NTGuru705
asked on
Return a DataTable from WebService
When I try to return a datatable from a webservice using vb.net I get this..
System.InvalidOperationExc eption: There was an error generating the XML document. ---> System.InvalidOperationExc eption: Cannot serialize the DataTable. DataTable name is not set.
at System.Data.DataTable.Writ eXmlSchema (XmlWriter writer, Boolean writeHierarchy)
at System.Data.DataTable.Syst em.Xml.Ser ialization .IXmlSeria lizable.Wr iteXml(Xml Writer writer)
at System.Xml.Serialization.X mlSerializ ationWrite r.WriteSer ializable( IXmlSerial izable serializable, String name, String ns, Boolean isNullable, Boolean wrapped)
at Microsoft.Xml.Serializatio n.Generate dAssembly. XmlSeriali zationWrit er1.Write2 0_DataTabl e(Object o)
at Microsoft.Xml.Serializatio n.Generate dAssembly. DataTableS erializer. Serialize( Object objectToSerialize, XmlSerializationWriter writer)
at System.Xml.Serialization.X mlSerializ er.Seriali ze(XmlWrit er xmlWriter, Object o, XmlSerializerNamespaces namespaces, String encodingStyle, String id)
--- End of inner exception stack trace ---
at System.Xml.Serialization.X mlSerializ er.Seriali ze(XmlWrit er xmlWriter, Object o, XmlSerializerNamespaces namespaces, String encodingStyle, String id)
at System.Xml.Serialization.X mlSerializ er.Seriali ze(XmlWrit er xmlWriter, Object o, XmlSerializerNamespaces namespaces, String encodingStyle)
at System.Xml.Serialization.X mlSerializ er.Seriali ze(XmlWrit er xmlWriter, Object o, XmlSerializerNamespaces namespaces)
at System.Xml.Serialization.X mlSerializ er.Seriali ze(TextWri ter textWriter, Object o, XmlSerializerNamespaces namespaces)
at System.Xml.Serialization.X mlSerializ er.Seriali ze(TextWri ter textWriter, Object o)
at System.Web.Services.Protoc ols.XmlRet urnWriter. Write(Http Response response, Stream outputStream, Object returnValue)
at System.Web.Services.Protoc ols.HttpSe rverProtoc ol.WriteRe turns(Obje ct[] returnValues, Stream outputStream)
at System.Web.Services.Protoc ols.WebSer viceHandle r.WriteRet urns(Objec t[] returnValues)
at System.Web.Services.Protoc ols.WebSer viceHandle r.Invoke()
System.InvalidOperationExc
at System.Data.DataTable.Writ
at System.Data.DataTable.Syst
at System.Xml.Serialization.X
at Microsoft.Xml.Serializatio
at Microsoft.Xml.Serializatio
at System.Xml.Serialization.X
--- End of inner exception stack trace ---
at System.Xml.Serialization.X
at System.Xml.Serialization.X
at System.Xml.Serialization.X
at System.Xml.Serialization.X
at System.Xml.Serialization.X
at System.Web.Services.Protoc
at System.Web.Services.Protoc
at System.Web.Services.Protoc
at System.Web.Services.Protoc
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.