473,778 Members | 1,934 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
Aug 28 '06 #1
1 1641
Uh, never mind.

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

dwilson

"Daniel Wilson" <d.******@EmbTr ak.comwrote in message
news:#D******** ******@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


Aug 28 '06 #2

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

Similar topics

3
1524
by: Vico | last post by:
Hi! I have a windows forms application and , what I basically do is: 1.- Instanciate a DataSet. 2.- Instanciate a XMlDataDocument attaching the DataSet to it. 3.- Load XmlDataDocument with a local XML document (C:\mydoc.xml) 2.- Bind it to a Datagrid. That is all!
2
6704
by: Ian Griffiths | last post by:
I have been given a schema, instances of which I'm required to be able to consume and generate. I'd like to be able to manipulate these instances as DataSets internally in my application. The schema defines the following simpleType: <xs:simpleType name="cs"> <xs:restriction base="xs:token"> <xs:pattern value="*"/> </xs:restriction> </xs:simpleType>
6
5540
by: Christoph Duesmann | last post by:
Hi ! Here's my problem in english :-) I want to convert the mssecure.xml file from Microsoft into an dataset to store it in an SQL-Database. My code in VB looks like this : Dim ds As New DataSet Dim doc As New Xml.XmlDocument
0
1030
by: thomas | last post by:
I must be doing something obvious wrong here, but: I perform a query to retrieve a dataset - I want to archive this in a SQL field for seperate retrieval later, while the original data may have moved on - so I write it to a string of XML using ds.GetXML(). I then write that string to the DB, into 1 'text' type field. (I know the data will never get over a certain size) Later I read that field and retrieve the data as a string and...
4
1345
by: Mark | last post by:
Hi, does anyone know how I can simply get the dataset that is bound to a DataGrid? Something like... DataSet dsDataSet = DataGrid1.Tables........... Thanks Mark
4
1311
by: Shapper | last post by:
Hello, I have a XML file that includes the node <item>: .... <title>...</title> <url>...</url> <item> <title>title 01</title> <description>description 01</description> </item>
5
1434
by: David Harris | last post by:
I am developing a type of data warehouse. Basically, we have 20 client survey machines that are each separated from the server by space and lack of network. Yet both need to speak to each other such that the clients know the latest configuration information and the server contains completed survey data from the clients. Currently I'm accomplishing this by using a few special database tables to control the flow of information, and using XML...
0
1193
by: =?Utf-8?B?TXlMYWJSdWJ5?= | last post by:
I am developing an application that will be able to be used offline from the SQL server and am trying to come up with a good way to do this. My thought at this moment is to basically work "offline" all the time and sync on a regular basis when connected. To do this, I have written several procedures to load and save data from the database and an XML file. However, when I load the informatiom from the XML file and then try to save it to...
0
811
by: Rob Meade | last post by:
Hi all, I have the following xml file... <?xml version="1.0" encoding="utf-8" ?> <Assembly> <!-- ' The name of the product/application/resource.
0
9629
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9465
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9923
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8954
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5370
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5497
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4031
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 we have to send another system
2
3627
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2863
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.