Need to retrieve large XML string from SP

Posts   
 
    
cjsmith
User
Posts: 4
Joined: 14-Jun-2010
# Posted on: 14-Jun-2010 14:02:05   

Hi there

I'm working on a legacy app and need to retrieve a large XML string returned by an SP. (It's doing a big join and then squashing into a string using FOR XML AUTO.)

I don't want to change the SP to use, say, output parameters, which is something I've seen mentioned a couple of times on the forum.

When I simply access the first cell in the first row of the return DataTable, I get a string truncated to 2033 characters (the actual returned value is 10s of thousands long). I know that if I use ADO.NET directly, I can get an XmlReader returned or use a DataReader in "sequential access" mode to get chunks of the string back and build the whole using a StringBuilder.

So, my problem is that: - I don't want to change the SP - I don't want to do direct data access (a la "new SqlConnection(connectionString)") because that defeats the object of abstracting things into a DAL

Is there any way I can get an XmlReader or a DataReader in sequential access mode from LLBL's generated code? Any other suggestions?

Regards

Chris Smith

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 14-Jun-2010 14:19:19   

Which LLBLGen Pro runtime library version (build number) are you using? Please follow the following guidelines to know how to get the correct build number: http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=7725

cjsmith
User
Posts: 4
Joined: 14-Jun-2010
# Posted on: 14-Jun-2010 14:22:41   

Sorry, forgot the details.

I am using 2.6 Final. We are accessing a SQL Server 2005 database.

I'm coding in C# 3.0 using the .NET framework 3.5.

Regards

Chris

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 14-Jun-2010 14:35:01   

We need the exact build number, please check the above mentioned thread.

cjsmith
User
Posts: 4
Joined: 14-Jun-2010
# Posted on: 14-Jun-2010 14:38:29   

The title bar of the designer says:

LLBL Gen Pro. Version: 2.6 Final (October 9th, 2009)

Cheers

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 14-Jun-2010 14:43:14   

How many rows do you get back in the returned DataTabe? As it seems like an MS issue.

Please check the following thread: http://support.microsoft.com/kb/310378

Cause: SQL Server returns the XML in multiple rows of 2,033 characters each.

cjsmith
User
Posts: 4
Joined: 14-Jun-2010
# Posted on: 14-Jun-2010 14:51:45   

Sorry, should have checked the returned DataTable for multiple rows. flushed

Thanks.