Below code:
1. Is only returning one row.. and Im not sure why.
2. I'd like to bind this result to an asp.net web control like
datalist, but's not working. I guess my confusion is that Im trying to
bind as a class object and not an xml file..
3. finally, I was wondering, is there anyway in .net to bind a web
control directly to webservice that is returning an xml file? How, if
you dont know what the service might render, is this what they refer to
as late binding?
public static string Gogetit()
{
string conn = "Data
Source=.\\SQLEXPRESS;AttachDbFilename=|DataDirecto ry|\\xx.mdf;Integrated
Security=True;User Instance=True";
using (SqlConnection connection = new
SqlConnection(conn))
{
connection.Open();
SqlCommand cmd = new SqlCommand("select * from book2 for
xml path", connection);
cmd.CommandType =
CommandType.Text;
XmlReader xr =
cmd.ExecuteXmlReader();
xr.MoveToContent();
return(xr.ReadOuterXml());