PC Review


Reply
Thread Tools Rate Thread

cannot fully convert for xml auto to string

 
 
Cezus
Guest
Posts: n/a
 
      23rd Oct 2008
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;
}
}
}
}
 
Reply With Quote
 
 
 
 
Jeff Johnson
Guest
Posts: n/a
 
      23rd Oct 2008
"Cezus" <(E-Mail Removed)> wrote in message
news:63cedbb5-c315-40ce-89ce-(E-Mail Removed)...

> 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.


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert 'System.Collections.ObjectModel.ReadOnlyCollection(Of String)' to '1-dimensional array of String'. roidy Microsoft VB .NET 12 17th Jul 2009 10:53 AM
string not fully populated in sql Michael de Vera Microsoft Dot NET 2 5th Feb 2008 07:52 PM
Auto convert an alphanumeric string (CIS9638S) to numbers only? =?Utf-8?B?U0Rlc21vbmQ=?= Microsoft Excel Worksheet Functions 0 7th Sep 2005 01:17 AM
RE: Auto convert an alphanumeric string (CIS9638S) to numbers only? =?Utf-8?B?Qi4gUi5SYW1hY2hhbmRyYW4=?= Microsoft Excel Worksheet Functions 0 7th Sep 2005 01:17 AM
RE: Auto convert an alphanumeric string (CIS9638S) to numbers only? =?Utf-8?B?R2FyeSBMIEJyb3du?= Microsoft Excel Worksheet Functions 0 7th Sep 2005 01:13 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:10 PM.