473,574 Members | 2,704 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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(forX MLCommand.Execu teXmlReader(),X mlReadMode.Frag ment); <-
....

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 2437
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*********@ho tmail.com> wrote in message
news:uv******** ******@TK2MSFTN GP10.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(forX MLCommand.Execu teXmlReader(),X mlReadMode.Frag ment); <-
...

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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
7315
by: John Francisco Williams | last post by:
Hi, I searched through this newsgroup looking for an answer for this, but didn't find any (it probably is here. Just didn't find it). I am trying to retrieve information from two related tables, using For XML Auto, and then use that in my C# app. I am only receiving the first row (and its child rows). This is what I do: Stored Procedure:...
3
51730
by: Mike P | last post by:
Is it possible to return a dataset from a stored procedure, or would you need to write the SQL in your .cs file to return the dataset? Any assistance would be really appreciated. Cheers, Mike
2
2013
by: Sandy | last post by:
Hello - I have the following stored procedure and code. I want to put the results in two textboxes. I get to the part where I create the dataset and then I don't know what to do. I tried using a dataview with no luck. Stored procedure: ALTER Proc spFillSbjRply ( @key int
4
357
by: Fred Nelson | last post by:
I have an applicatioin that I'm writing that uses a "case" file that contains over 350 columns and more may be added in the future. I would like to create a dataset with all the column names and only one case record that is delivered by a stored procedure. (I have a stored procedure that works so my question is only on loading the DataSet.)...
9
47187
by: Nikolay Petrov | last post by:
How to fill DataSet from stored procedure?
3
3402
by: vickilynnpgc | last post by:
I have a tsql stored procedure I want to drag from server explorer onto an xsd file. I get the error ' xml schema could not be interpreted'. The stored procedure does a select from a udf, that's it.
5
3120
by: John | last post by:
Hi, I am developing a windows app using C# 2005. This app uses SQL Server or Oracle database depending on the what the user is using. Can I create one typed dataset and use it for SQL Server and Oracle? Probably not. How can I structure my data access layer so the app will be switching easily between those two databases with a locally...
3
4866
by: Jon B | last post by:
Hi There! I'm looking into Strongly Typed DataSets in the .NET Framework. I know it can generated strongly typed tables as objects and column names as properties. However, one thing that I would like to know is if it wraps database Stored Procedures as methods and functions? For instance, if I have a Stored Procedure called...
10
1346
by: Steve | last post by:
Ok, I hit a wall and I'm stuck. I have a web form that has a textbox were the user can enter in 1 to many usernames, then the user has to validate the user to make sure the user exists. I have a stored procedure that can only take one username at a time, so I need to keep calling this stored procedure with all of the usernames in the textbox(...
0
7814
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...
0
8067
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8249
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6464
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...
1
5631
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5307
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3748
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...
1
2252
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
0
1071
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...

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.