cannot fully convert for xml auto to string

C

Cezus

Hello,

I cannot convert the following query in the dataset to a string. It
says it cannot get more then 2034 chars long... the string just ends
at 2034 characters...

this is where it goes wrong in the code:

string xml = Convert.ToString(mijnQTA.GetDataXMLForAuto());

it just won't put in more then 2034 characters in the string.

I hope somebody can help me?

With Kind Regards,

Cees van Altena.



query in the dataset:

SELECT Studentennummer, Voornaam, Initialen, Tussenvoegsel,
Achternaam, Geslacht, Straatnaam, Huisnummer, Postcode,
Telefoonnummer, Mobiel, Emailadres,
Domeincode
FROM Studenten FOR XML AUTO, ELEMENTS, ROOT('RootElement')

Generic Handler code:

using System;
using System.Collections;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml.Linq;
using System.Data.SqlClient;
using System.Xml;

namespace demoService
{
/// <summary>
/// Summary description for $codebehindclassname$
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class XsltXMLForAuto : IHttpHandler
{

public void ProcessRequest(HttpContext context)
{
// Maak een QueriesTableAdapter
DemoTableAdapters.QueriesTableAdapter mijnQTA = new
DemoTableAdapters.QueriesTableAdapter();

// Voer de query uit, resultaat is een string
string xml =
Convert.ToString(mijnQTA.GetDataXMLForAuto());

// Stop xml in een XmlDocument
XmlDocument mijnXmlDocument = new XmlDocument();
mijnXmlDocument.LoadXml(xml);

XmlNode mijnNode = mijnXmlDocument.DocumentElement;

context.Response.ContentType = "text/xml";
context.Response.Write(mijnNode.OuterXml);

}

public bool IsReusable
{
get
{
return false;
}
}
}
}
 
J

Jeff Johnson

I cannot convert the following query in the dataset to a string. It
says it cannot get more then 2034 chars long...

What is "it"? Are you actually getting an error message?
the string just ends at 2034 characters...

I know absolutely nothing about the table adapters or all this generated
data handling (don't use data binding, personally), but I can say that if
it's calling stored procedures that you wrote then those are the first
things to look at. You might just have a DECLARE @RetString 2034 in there
somewhere. I've seen that bite people more than once, myself included. But
then it looks like you have a direct SQL statement there, not an SP, so
that's probably not the answer.
 
Top