using System; using System.Data; using System.Data.Sql; using System.Data.SqlClient; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; public partial class Admin_varunda : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { SqlConnection toru = new SqlConnection( ConfigurationManager .ConnectionStrings["baas1ConnectionString"] .ConnectionString); SqlCommand kask = new SqlCommand( "SELECT * " + "FROM dbo.ajaveeb " + "FOR XML RAW('rida'),ROOT('blogi')"); kask.Connection = toru; toru.Open(); // muudame vastuse MIME tüübi xml'iks Response.ContentType = "text/xml"; Response.Write(""); Response.Write(kask.ExecuteScalar().ToString()); toru.Close(); } }