views:

512

answers:

1

I am designing an ASP.NET website that will run sqlcmd, get some output and put this into a grid on screen.

I was wondering if there is a method for reading the results of a query from sqlcmd into some kind of format that I can work with, XML, DataSet etc.

Is there a friendly switch in sqlcmd that will output it in a nice format or will I have to parse it myself?

+1  A: 

You can use the SqlCommand.ExecuteXmlReader() function. It will return the object of type XmlReader.
You may get little help here about ExecuteXmlReader().