Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 Problem with large sql return

Author  Topic 

IceDread
Yak Posting Veteran

66 Posts

Posted - 2008-09-22 : 11:05:44
Hi!

I've a return that is larger then 4k chars from an stored procedure, the return is "FOR XML RAW('xxx'), ELEMENTS, ROOT('x')" and the sp by itself works good when I run run it in ms sql 2005.

The problem is my c# (.net 3.5) program (I believe).

How do I catch my sp return properly? It seams my application only gets the first 2033 chars.

Thanks for help!





SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-09-22 : 11:29:41
Change your C# code to proper datatype (XML) or string for more than 2033 bytes.



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2008-09-22 : 11:50:53
quote:
Originally posted by IceDread

Hi!

I've a return that is larger then 4k chars from an stored procedure, the return is "FOR XML RAW('xxx'), ELEMENTS, ROOT('x')" and the sp by itself works good when I run run it in ms sql 2005.

The problem is my c# (.net 3.5) program (I believe).

How do I catch my sp return properly? It seams my application only gets the first 2033 chars.

Thanks for help!








This may sound crazy, but maybe if you posted your code or if you provided more specifics we could help you better?

- Jeff
http://weblogs.sqlteam.com/JeffS
Go to Top of Page

IceDread
Yak Posting Veteran

66 Posts

Posted - 2008-09-23 : 08:47:11
Yes it does.

However, thanks for trying.

This link might be of interest for someone else experiencing my problem.
http://aspnetresources.com/blog/executescalar_truncates_xml.aspx
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-09-24 : 01:03:17
Why would you use ExecuteScalar on XML in the first place?
And as a sidenote, don't you think telling us you ussed ExecuteScalar is a vital piece of information to solve your problem?
Just as Jeff, wrote; Post your code and we can help. We can't read your mind.



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page
   

- Advertisement -