XML -> DataSet truncating

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Daniel Wilson

    #1

    XML -> DataSet truncating

    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.SqlDa taAdapter("MySt oredProcedureTh atReturnsXML",
    "MyConnectionSt ring")Dim dsXML As New
    Data.DataSetdta XML.SelectComma nd.CommandType =
    CommandType.Sto redProceduredta XML.SelectComma nd.Parameters.C lear()dtaXML.Se l
    ectCommand.Para meters.Add("@ID ", SqlDbType.Int). Value = IIf(txtSO_ID.Te xt =
    "", "0", txtSO_ID.Text)d sXML.Clear()dta XML.Fill(dsXML) If dsXML.Tables.Co unt
    0 ThenIf dsXML.Tables.It em(0).Rows.Coun t 0 ThentxtXML.Text =
    Convert.ToStrin g(dsXML.Tables. Item(0).Rows.It em(0).Item(0))E nd IfEnd IfEnd
    SubThe Convert.ToStrin g 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


  • Daniel Wilson

    #2
    Re: XML -&gt; DataSet truncating

    Uh, never mind.

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

    dwilson

    "Daniel Wilson" <d.wilson@EmbTr ak.comwrote in message
    news:#DyCGrtyGH A.4632@TK2MSFTN GP06.phx.gbl...
    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.SqlDa taAdapter("MySt oredProcedureTh atReturnsXML",
    "MyConnectionSt ring")Dim dsXML As New
    Data.DataSetdta XML.SelectComma nd.CommandType =
    >
    CommandType.Sto redProceduredta XML.SelectComma nd.Parameters.C lear()dtaXML.Se l
    ectCommand.Para meters.Add("@ID ", SqlDbType.Int). Value = IIf(txtSO_ID.Te xt
    =
    "", "0", txtSO_ID.Text)d sXML.Clear()dta XML.Fill(dsXML) If
    dsXML.Tables.Co unt
    0 ThenIf dsXML.Tables.It em(0).Rows.Coun t 0 ThentxtXML.Text =
    Convert.ToStrin g(dsXML.Tables. Item(0).Rows.It em(0).Item(0))E nd IfEnd IfEnd
    SubThe Convert.ToStrin g 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
    >
    >

    Comment

    Working...