Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Sql Server multiple XML result sets to ADO.NET

Reply
Thread Tools

Sql Server multiple XML result sets to ADO.NET

 
 
randall g
Guest
Posts: n/a
 
      12-29-2003
I have a stored procedure which returns multiple result sets, enclosing
each in its own tag. This works in ADO but not ADO.NET, where an error
is returned by ExecuteXmlReader:
"Invalid command sent to ExecuteXmlReader. The command must return an
Xml result."

The procedure looks like this:

create procedure xxx as
select '<tag1>'
select * .... for xml auto
select '</tag1>'
select '<tag2>'
select * .... for xml auto
select '</tag2>'
select '<tag3>'
select * .... for xml auto
select '</tag3>'
return
go

It is the "select 'literal'" statements that cause the problem, however
this works perfectly well in ADO.

How can I control the XML tagging for multiple result sets, in ADO.NET?




 
Reply With Quote
 
 
 
 
Iain
Guest
Posts: n/a
 
      12-29-2003
I think you probably need to use for xml explicit which seems to be the way
in which more complex xml is best handled.

Iain
"randall g" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I have a stored procedure which returns multiple result sets, enclosing
> each in its own tag. This works in ADO but not ADO.NET, where an error
> is returned by ExecuteXmlReader:
> "Invalid command sent to ExecuteXmlReader. The command must return an
> Xml result."
>
> The procedure looks like this:
>
> create procedure xxx as
> select '<tag1>'
> select * .... for xml auto
> select '</tag1>'
> select '<tag2>'
> select * .... for xml auto
> select '</tag2>'
> select '<tag3>'
> select * .... for xml auto
> select '</tag3>'
> return
> go
>
> It is the "select 'literal'" statements that cause the problem, however
> this works perfectly well in ADO.
>
> How can I control the XML tagging for multiple result sets, in ADO.NET?
>
>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
SqlDataSource Multiple Result Sets Mike ASP .Net 1 03-15-2007 10:34 PM
JDOM - Combining several result sets into one xml file jonas.donas@gmx.net Java 0 10-10-2005 03:14 PM
1. Ruby result: 101 seconds , 2. Java result:9.8 seconds, 3. Perl result:62 seconds Michael Tan Ruby 32 07-21-2005 03:23 PM
DataAdapter and multiple result sets Michael C# ASP .Net Web Services 2 05-10-2005 06:05 PM
Shaping data/multiple result sets - hmmm... Mike Kingscott ASP .Net 0 08-27-2003 12:39 PM



Advertisments