cannot fully convert for xml auto to string

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Cezus

    cannot fully convert for xml auto to string

    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.ToStrin g(mijnQTA.GetDa taXMLForAuto()) ;

    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('RootEleme nt')

    Generic Handler code:

    using System;
    using System.Collecti ons;
    using System.Data;
    using System.Linq;
    using System.Web;
    using System.Web.Serv ices;
    using System.Web.Serv ices.Protocols;
    using System.Xml.Linq ;
    using System.Data.Sql Client;
    using System.Xml;

    namespace demoService
    {
    /// <summary>
    /// Summary description for $codebehindclas sname$
    /// </summary>
    [WebService(Name space = "http://tempuri.org/")]
    [WebServiceBindi ng(ConformsTo = WsiProfiles.Bas icProfile1_1)]
    public class XsltXMLForAuto : IHttpHandler
    {

    public void ProcessRequest( HttpContext context)
    {
    // Maak een QueriesTableAda pter
    DemoTableAdapte rs.QueriesTable Adapter mijnQTA = new
    DemoTableAdapte rs.QueriesTable Adapter();

    // Voer de query uit, resultaat is een string
    string xml =
    Convert.ToStrin g(mijnQTA.GetDa taXMLForAuto()) ;

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

    XmlNode mijnNode = mijnXmlDocument .DocumentElemen t;

    context.Respons e.ContentType = "text/xml";
    context.Respons e.Write(mijnNod e.OuterXml);

    }

    public bool IsReusable
    {
    get
    {
    return false;
    }
    }
    }
    }
  • Jeff Johnson

    #2
    Re: cannot fully convert for xml auto to string

    "Cezus" <ceesvana@gmail .comwrote in message
    news:63cedbb5-c315-40ce-89ce-2249b6af3789@d4 5g2000hsc.googl egroups.com...
    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.


    Comment

    Working...