J
jason
In vs.net 2005, is there any way to bind a datalist to a method
returning an xml string like this one?
public static string Gogetit(string name)
{
string conn = "Data
Source=.\\SQLEXPRESS;AttachDbFilename=|DataDirectory|\\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());
When I attempt, the datalist items do not show up.
Also, can anybody tell me why the above might be only returning the
first row?
And, if the above was encapsulated in a webservice, would there be any
way to bind the datalist to it? does it even make sense to ask that?
Why would anybody even do that?
returning an xml string like this one?
public static string Gogetit(string name)
{
string conn = "Data
Source=.\\SQLEXPRESS;AttachDbFilename=|DataDirectory|\\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());
When I attempt, the datalist items do not show up.
Also, can anybody tell me why the above might be only returning the
first row?
And, if the above was encapsulated in a webservice, would there be any
way to bind the datalist to it? does it even make sense to ask that?
Why would anybody even do that?