all groups > dotnet xml > august 2006 >
You're in the

dotnet xml

group:

XML -> DataSet truncating


XML -> DataSet truncating Daniel Wilson
8/28/2006 3:46:36 PM
dotnet xml:
We have a stored procedure that is giving us an XML representation (using
FOR XML Explicit) of a sales order. Sometimes that evaluats to quite a long
string. Unfortunately, this XML string is being truncated to 2034
characters before we can do anything with it.

Here's our code:
Private Sub LoadXML()Dim dtaXML As New
SqlClient.SqlDataAdapter("MyStoredProcedureThatReturnsXML",
"MyConnectionString")Dim dsXML As New
Data.DataSetdtaXML.SelectCommand.CommandType =
CommandType.StoredProceduredtaXML.SelectCommand.Parameters.Clear()dtaXML.Sel
ectCommand.Parameters.Add("@ID", SqlDbType.Int).Value = IIf(txtSO_ID.Text =
"", "0", txtSO_ID.Text)dsXML.Clear()dtaXML.Fill(dsXML)If dsXML.Tables.Count
[quoted text, click to view]
Convert.ToString(dsXML.Tables.Item(0).Rows.Item(0).Item(0))End IfEnd IfEnd
SubThe Convert.ToString line is truncating at 2034 characters.What are we
doing wrong?Thanks.-- Daniel Wilson <D dot Wilson at EmbTrak dot Com>Senior
Software Solutions Developer Embtrak Team, DV Brown Company 864-292-5888

Re: XML -> DataSet truncating Daniel Wilson
8/28/2006 3:49:41 PM
Uh, never mind.

We need to concatenate the results from all the rows. Then we're fine.

dwilson

[quoted text, click to view]

AddThis Social Bookmark Button