How to read the xml returned by select query with "For XML Auto,Elements"

Hi all,

 I am writing a select query which produces huge xml data.Now i want to read that data from my web application a save it as xml file.

How can i do that.

I am using asp.net vb.net.

0
aditya_raj
12/14/2007 4:36:50 AM
asp.net.sql-datasource 29906 articles. 0 followers. Follow

1 Replies
633 Views

Similar Articles

[PageSpeed] 19

 Check if this post is helpful.

http://forums.asp.net/t/1182514.aspx 


Thanks,
Dhimant Trivedi
"When the going gets tough, tough gets going."

"Mark as Answer" the post(s) which helped you solve the problem
0
dhimant
12/14/2007 11:23:45 AM
Reply:

Similar Artilces:

Return value when selecting "FOR XML" getting truncated
I'm using SQL Server 2005. I have stored procedure that selects a bunch of data from different tables and returns the results using the FOR XML clause. The problem is when I'm loading the XML, I notice that after a little over 2,000 characters, the XML string is getting truncated and thus I can't load it into an XmlDocument object. I'm also using the Microsoft Enterprise Library data access block, if that makes any difference. Here's the code:  Database db = DatabaseFactory.CreateDatabase(DATABASE_NAME); string sqlCommand = "..."; using (DbCommand dbCommand = db.GetStoredProcC...

How to give "And" and "OR" in my sql query?
      My layout (.aspx) have 3 TextBox and 2 Dropdownlist and 1 Button which just looks like Search KeyWord 【Texbox1】DorpDownList1 (have 2 items "And" and "Or")  【TextBox2】DorpDownList2 (have 2 items "And" and "Or") 【TextBox3】 Button ( this Button is for submit query)   1 "txtQuery" style="Z-INDEX: 101; LEFT: 152px; POSITION: absolute; TOP: 32px" runat="server" 2 Width="264px"> 3 "ddlBoolean" style="Z-INDEX: 102; LEFT: 152px; ...

regarding "in" and "=" in a SQL query
Hi, I am using a sybase database client . When i use "in" in a complex nested query say "select * from emp where emp_id in (select emp_id ..........)" then the execution time is really slow but in the same nested query when i use = as in "select * from emp where emp_id = (select emp_id ..........)", then the query is fast. Is there any particular reason for the same? Regards, Supreeth The obvious difference is that the "=" implies that the subquery can only return a single value as opposed to the "in" which implies that th...

XML DataSet/DataView equivalent of SQL "Select TOP X..."?
I have an XML file loaded into a DataSet (ds)...Created a DataView (dv) on ds...Filtered through data with dv.RowFilter = "something > somethingelse"I would like to only return first 2 rows of data (instead of every row that meets dv.RowFilter criteria) for my DataView to bind to a DataList...Is this possible?Tx for any input... I figured this out on my own...I'll post what I did below just in case someone else needs it. (in VB.NET)Dim myDS As New DataSet()Dim myDV As DataViewDim pagedData As New PagedDataSource()Dim iLen, iWid As IntegeriLen = CType(tbLength.Text, I...

"Initialize Active Directory for Hosting" Fails
Trying to get HMC set up and installed on a new server; been following the step-by-step instructions included with the software.  Everything's was going smoothly until I got to the "Initialize Active Directory for Hosting" step, at which point I started getting this error: "Only one top level element is allowed in an XML document".  I haven't been able to find any info on this error as it relates to an MPS deployment, and haven't made much progress moving past it.  Here's the proc.xml that provtest is trying to process and failing on:<req...

Multiple "AND" and "OR" Statements in an SQL Query
Hello,  I've got a table called "plants" which, up-until-recently, was being searched by category using the following SQL (and using the CategoryID field): SELECT plants.Latin_Name, Size.ekm_ID, plants.Common_Name, plants.Short_Description, plants.Thumb_URL, plants.CategoryID, plants.ProductID, Size.Size, Size.Price, Size.MostPopular FROM plants INNER JOIN Size ON plants.CategoryID = Size.CategoryID AND plants.ProductID = Size.ProductID WHERE (plants.CategoryID = @CategoryID) AND (Size.MostPopular = 'True') AND (Size.Availability = 'True') ORDER BY plants.Latin_Name  I now want ...

query "For XML" problem?...or not!
hi guys i'm developing a multi-tier web application which at a given point calls a stored procedure that returns data formated as XML ( 'select ..... for xml auto' basically).That SP returns a list of tasks allocated to 1 or more resources. The problem is that from time to time (and that is totally random, anything from 30seconds to 10mins) whenever the code calls that SP, the XML structure isn't there, so no data is listed.Question is: is this a problem within SQL Server XML support or anything related to .NET?I'm using .NET 2.0.50727 with VS2005 8.0.50727.42, ...

"Attempt to use an "XML" extension that has not been registered..."
Hello, I am using Reporting Service in server mode.I currently have a report in which in include a few subreports. All of them use the same datasource (sqlserver 2005 database connectionstring)I have to add another report which is based on XML data. To do so, I created a new shared datasource, designed my query, added the report parameters, tested the query... This works but when I try to deploy this report on the report server I am getting an error I do not understand:"Attemps to use an "XML" extension of data that has not been registered for this report server"I do...

superreview granted: [Bug 349705] In <wizard.xml>, Strict "Warning: function cancel does not always return a value" : [Attachment 234985] (Av1-XPFE) <wizard.xml>
neil@parkwaycc.co.uk <neil@httl.net> has granted Serge Gautherie <sgautherie.bz@free.fr>'s request for superreview: Bug 349705: In <wizard.xml>, Strict "Warning: function cancel does not always return a value" https://bugzilla.mozilla.org/show_bug.cgi?id=349705 Attachment 234985: (Av1-XPFE) <wizard.xml> https://bugzilla.mozilla.org/attachment.cgi?id=234985&action=edit ...

superreview granted: [Bug 211046] In <chrome://global/content/bindings/tree.xml>, "Error: this.treeBoxObject.selection has no properties" : [Attachment 147569] (Av2b) <tree.xml>
Serge GAUTHERIE <gautheri@noos.fr> has granted Serge GAUTHERIE <gautheri@noos.fr>'s request for superreview: Bug 211046: In <chrome://global/content/bindings/tree.xml>, "Error: this.treeBoxObject.selection has no properties" http://bugzilla.mozilla.org/show_bug.cgi?id=211046 Attachment 147569: (Av2b) <tree.xml> http://bugzilla.mozilla.org/attachment.cgi?id=147569&action=edit ------- Additional Comments from Serge GAUTHERIE <gautheri@noos.fr> Keeping: {{ (Av2) <tree.xml> patch 2004-04-19 15:57 PDT varga: review+ jag: super...

superreview requested: [Bug 349705] In <wizard.xml>, Strict "Warning: function cancel does not always return a value" : [Attachment 234985] (Av1-XPFE) <wizard.xml>
Serge Gautherie <sgautherie.bz@free.fr> has asked neil@parkwaycc.co.uk <neil@httl.net> for superreview: Bug 349705: In <wizard.xml>, Strict "Warning: function cancel does not always return a value" https://bugzilla.mozilla.org/show_bug.cgi?id=349705 Attachment 234985: (Av1-XPFE) <wizard.xml> https://bugzilla.mozilla.org/attachment.cgi?id=234985&action=edit ...

superreview granted: [Bug 211046] In <chrome://global/content/bindings/tree.xml>, "Error: this.treeBoxObject.selection has no properties" : [Attachment 146534] (Av2) <tree.xml>
jag (Peter Annema) <jag@tty.nl> has granted Serge GAUTHERIE <gautheri@noos.fr>'s request for superreview: Bug 211046: In <chrome://global/content/bindings/tree.xml>, "Error: this.treeBoxObject.selection has no properties" http://bugzilla.mozilla.org/show_bug.cgi?id=211046 Attachment 146534: (Av2) <tree.xml> http://bugzilla.mozilla.org/attachment.cgi?id=146534&action=edit ------- Additional Comments from jag (Peter Annema) <jag@tty.nl> var c = this.currentIndex; - var l = this.treeBoxObject.view.rowCount - 1; + var l = this.v...

superreview requested: [Bug 211046] In <chrome://global/content/bindings/tree.xml>, "Error: this.treeBoxObject.selection has no properties" : [Attachment 146534] (Av2) <tree.xml>
Serge GAUTHERIE <gautheri@noos.fr> has asked jag (Peter Annema) <jag@tty.nl> for superreview: Bug 211046: In <chrome://global/content/bindings/tree.xml>, "Error: this.treeBoxObject.selection has no properties" http://bugzilla.mozilla.org/show_bug.cgi?id=211046 Attachment 146534: (Av2) <tree.xml> http://bugzilla.mozilla.org/attachment.cgi?id=146534&action=edit ...

Textarea element returns "carriage return/line feed" but I want j ust the "\n"
All, I have written a small cgi script that allows my users to submit some text to a db. everything work well except that it seems to be doubling their return keys. Each time they modify their entry the lines get one return key further apart. I read this in one of the Oreilly books... "Upon submission of the form, the browser collects all the lines of text, each separated by "%0D%0A" (carriage return/line feed)" how can I convert the "%0D%0A" to just the regular "\n" character? I cannot use the CGI.pm module. Thanks, Brad ******...

Web resources about - How to read the xml returned by select query with "For XML Auto,Elements" - asp.net.sql-datasource

Resources last updated: 1/19/2016 4:02:12 AM