Sunday, April 18, 2010

How to generate XML document using Store Procedure in SQL Server

CREATE PROCEDURE  sp_getXML 
AS
BEGIN
    SELECT    C.CategoryID,
            C.CategoryName,
            F.FurnitureID,F.FurnitureName,
            SUM(F.FurniturePrice) FurniturePrice
    FROM tbl_Furniture F
    INNER JOIN tbl_Category  C ON F.CategoryID = C.CategoryID   
    GROUP BY C.CategoryID,C.CategoryName,F.FurnitureID,F.FurnitureName
    ORDER BY C.CategoryID
    FOR XML AUTO, ROOT('Furnitures')
END

1 comment:

  1. can u please tell me

    how we can send the data of selected row of a gridview when we click the button in front of the row to the next page in text boxes to edit that particular data.

    Requirements are:--
    1. Gridview on firstpage accesing data using sql query through C#.
    2. we have use template field to place button in front of each row.
    3.when we click on button that row data is send to next page on the text boxes where we can edit them.

    please its urgent
    reply me at

    erravi.cse@gmail.com

    ReplyDelete