Tuesday, December 25, 2012

Return SQL Query Result as XML in SQL Server- AUTO Mode

In previous post Return SQL Query Result as XML in SQL Server , I explained For XML clause for getting the query result as XML. I also explained RAW mode of this clause. Today I will explain AUTO  mode in FOR XML  clause.

Monday, December 24, 2012

Return SQL Query Result as XML in SQL Server

SQL Server gives you option to retrieve data as XML by supporting For XML clause, which you can use as a part of your query. For XML clause supports different options that let you define the format of XML data.

For XML clause supports four modes- RAW, AUTO, EXPLICIT, PATH. When you include the FOR XML clause in your query, you must specify one of these four modes.

Wednesday, November 28, 2012

Bind asp.net dropdownlist to xml file


Today I was working on binding the dropdown list control from an  XML file. Besides binding the dropdown list from XML file I had to sort the items into ascending order. So I am explaining here what I have done for this.

Let’s define an  XML file first. It consists of Department name of a company.
^ Scroll to Top