Click here to Skip to main content
15,891,688 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,
i have written one Stored Procdure which has two paramters. One is custnumber(input parameter) another one is xmloutput parameter(outputparameter).While passing custid its creating xmloutput result.To generate xmloutput i have written:
FOR XML PATH('Customer'), ROOT('doc').
While running this Stored Procdure from backend i am getting the correct result in xml format.

Now i want to call this Stored Procedure from C#.net DAL layer return the Stored Procedure result should be in Dataset(i mean there will be a method whose return type will be dataset). And while i will call this dataset return type method from presentation layer want to display in gridview: how can i do this????pls help with sample coding.
Posted
Updated 9-Jan-11 20:01pm
v2

This should help you out:
ADO.NET Overview[^]
Using Dataset in ADO.NET[^]

Using ADO.NET, get data in a dataset. Once you have dataset, pass that back to UI layer where you can bind it to the datagrid.

While fetching data, instead of query you would be using stored procedure. For that, commandType would be SP.

Try!
 
Share this answer
 
check out the below article to get that to dataset as you said.

Convert XML to Strongly Typed DataSets[^]

In your SP,have a refcursor something like below & get the xml column selected into the ref cursor.


PROCEDURE PRC_GET_TEMPLATES(

o_output OUT PKG_XXX.g_refcur
)
IS


BEGIN
OPEN o_output FOR
SELECT * FROM table
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900