472,100 Members | 2,200 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,100 software developers and data experts.

Problemi su Dataset, stored procedure ed XML

Ho la necessità di inserire i risultati di una stored procedure in un
dataset.
Mi spiego meglio ....
Ho costruito una store procedure che incapsula una query di lettura su un
database sqlserver che restituisce di dati in formato xml.
La clausola utilizzata per avere il risultato in xml è: FOR XML
AUTO,XMLDATA, e la stored procedure si chiama SP_Lettura ed accetta tre
parametri interi P1,P2,P3.

....
DataSet ds=new DataSet();
ds.ReadXml(forXMLCommand.ExecuteXmlReader(),XmlRea dMode.Fragment); <-
....

Quando eseguo la linea segnata ottengo il seguente errore:
Line 1: Incorrect syntax near 'sp_Lettura'

Se invece di utilizzare una stored procedure utilizzo una query il problemma
non esiste.

Accetto consigli su come caricare i risultati xml di una sotred procedure in
un dataset.
Grazie anticipatamente per la risposta
Nov 16 '05 #1
1 2376
Hi,

Could you post the code creating the forXMLCommand instance? At least you
might want to check whether the CommandType is set to 'Stored Procedure'.

--
Sincerely,
Dmitriy Lapshin [C# / .NET MVP]
Bring the power of unit testing to the VS .NET IDE today!
http://www.x-unity.net/teststudio.aspx

"Telemaco" <no*********@hotmail.com> wrote in message
news:uv**************@TK2MSFTNGP10.phx.gbl...
Ho la necessità di inserire i risultati di una stored procedure in un
dataset.
Mi spiego meglio ....
Ho costruito una store procedure che incapsula una query di lettura su un
database sqlserver che restituisce di dati in formato xml.
La clausola utilizzata per avere il risultato in xml è: FOR XML
AUTO,XMLDATA, e la stored procedure si chiama SP_Lettura ed accetta tre
parametri interi P1,P2,P3.

...
DataSet ds=new DataSet();
ds.ReadXml(forXMLCommand.ExecuteXmlReader(),XmlRea dMode.Fragment); <-
...

Quando eseguo la linea segnata ottengo il seguente errore:
Line 1: Incorrect syntax near 'sp_Lettura'

Se invece di utilizzare una stored procedure utilizzo una query il
problemma
non esiste.

Accetto consigli su come caricare i risultati xml di una sotred procedure
in
un dataset.
Grazie anticipatamente per la risposta


Nov 16 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by John Francisco Williams | last post: by
3 posts views Thread by Mike P | last post: by
2 posts views Thread by Sandy | last post: by
4 posts views Thread by Fred Nelson | last post: by
9 posts views Thread by Nikolay Petrov | last post: by
3 posts views Thread by vickilynnpgc | last post: by
5 posts views Thread by John | last post: by
10 posts views Thread by Steve | last post: by

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.