You can retrieve Xml from database this way http://davidhayden.com/blog/dave/archive/2006/05/04/2936.aspx
or
use technique in following article http://www.sqlservercentral.com/articles/XML/62054/
static void Main(string[] args)
{
//let us make a connection first
String str;
str = "Data Source=TOSHIBA-USER\\SQL2005;Initial Catalog=XmlTest;";
str = str + "Persist Security Info=True;User ID=sa;Password=sa2005";
SqlConnection cn = new SqlConnection(str);
cn.Open();
//Let us make a command
SqlCommand cmd = new SqlCommand();
cmd.Connection = cn;
cmd.CommandText = "GetEmployeeData";
cmd.CommandType = CommandType.StoredProcedure;
//What we need next is an XMLReader and call
//ExecuteXMLReader method of SqlCommand.
XmlReader r;
r = cmd.ExecuteXmlReader();
//Read the data from XMLReader and Load into
//the String Builder
StringBuilder xmlData = new StringBuilder();
while (r.Read())
{
xmlData.Append(r.ReadOuterXml());
}
//Print the output
Console.WriteLine(xmlData.ToString());
//Close the Reader and DB Connection
r.Close();
cn.Close();
}
Kamran Shahid
Sr. Software Engineer
(MCP,MCAD.net,MCSD.net,MCTS,MCPD.net[web])
Remember to click "Mark as Answer" on the post that helps U