473,473 Members | 2,005 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

XML truncated on client when using FOR XML...

Hi:

I have a stored proc that returns an XML doc. Testing it in Query Analyzer,
it looks fine. However consuming it in C# application truncates xml string
when result is converted to string from an ExecuteScalar data command. May
have something with string conversion because looking at result in a
datatable column looks OK, but when converting (tbl.Rows[0][0].String()) it
gets truncated. Why?

Thanks,
Charlie
Dec 12 '06 #1
2 2237

FOR XML returns XML data as a single-field text result with as many
rows required to contain all the data. It may be more than one row
and thus Rows[0][0] and ExecuteScalar will both truncate the data.

SqlCommand has a SQL-Server specific method ExecuteXmlReader designed
to handle FOR XML results.

HTH,

Sam
------------------------------------------------------------
We're hiring! B-Line Medical is seeking Mid/Sr. .NET
Developers for exciting positions in medical product
development in MD/DC. Work with a variety of technologies
in a relaxed team environment. See ads on Dice.com.
On Tue, 12 Dec 2006 14:34:26 -0500, "Charlie@CBFC"
<ch*****@cbfconsulting.comwrote:
>Hi:

I have a stored proc that returns an XML doc. Testing it in Query Analyzer,
it looks fine. However consuming it in C# application truncates xml string
when result is converted to string from an ExecuteScalar data command. May
have something with string conversion because looking at result in a
datatable column looks OK, but when converting (tbl.Rows[0][0].String()) it
gets truncated. Why?

Thanks,
Charlie
Dec 12 '06 #2
You may look at this article here:
http://support.microsoft.com/kb/310378
Even though it relates to ExcuteReader, the answer is similar (only
that ExcuteScalar returns only the first row, and ExecuteReader you can
loop through the rows with " While ( dr.Read() ) "

On Dec 12, 9:34 pm, "Charlie@CBFC" <char...@cbfconsulting.comwrote:
Hi:

I have a stored proc that returns anXMLdoc. Testing it in Query Analyzer,
it looks fine. However consuming it in C# applicationtruncatesxmlstring
when result is converted to string from anExecuteScalardata command. May
have something with string conversion because looking at result in a
datatable column looks OK, but when converting (tbl.Rows[0][0].String()) it
gets truncated. Why?

Thanks,
Charlie
Dec 27 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Jay Chan | last post by:
The transaction log in a database in our SQLSERVER-2000 server has grown to 16GB. I cannot shrink the transaction log manually because it says that the entire 16GB log size is not free. This is...
5
by: localhost | last post by:
Network socket client code works correctly: byte nameBytes = new byte; recvData = inStream.Read( nameBytes , 0 , 1024 ); string fileNameRaw = System.Text.Encoding.UTF8.GetString( nameBytes );...
2
by: seash | last post by:
H iam developing my windows form application(ide:visual studio.net 2003, visual c#) on windows 2000 professional operating system , but when i run the exe on Xp operating system, the screen ...
5
by: Bertus Dam | last post by:
Hi, When I use System.Web.Mail.MailMessage to send an e-mail, my message gets truncated. It's 12kB instead of 140kB. How can I solve this?? Bertus
5
by: z. f. | last post by:
hi, i have a vb.net web application and i make a request using internet explorer to an aspx page. the aspx page size if over 170KB, and the page in internet explorer looks truncated and in the...
2
by: bil.shah | last post by:
Hi, I am listening to a port for data but I am not able to recieve whole data, I only get truncated data. Client sends me data that exceeds 40K and the data I recieve in my callback function is...
1
by: automation | last post by:
There is a truncation error of my Web Application using PHP 5.04, MySQL 5.022, and HTML(IE 6.0) whereby the MySQL Result Set is being truncated on the HTML page, even though the CSS Div Page Height...
7
by: TC | last post by:
I've produced an Access application for a client. For one report, text gets cut-off at the right margin when we print the report. It does this only when we print; it doesn't happen when we view the...
0
by: RickVidallon | last post by:
Missing or Truncated Body Text in Email Application - 2 Strange Examples... There is no earthly reason why this is happening! EXAMPLES HERE: http://65.36.227.70/actmailer/ We have a...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.