using System; using System.Data; using System.Data.Sql; using System.Data.SqlClient; using System.Configuration; using System.Collections; public partial class admin_pealkirjaloetelu : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { SqlConnection yhendus=new SqlConnection( ConfigurationManager.ConnectionStrings["yhendus1"]. ConnectionString ); SqlCommand kask = new SqlCommand( "SELECT pealkiri FROM ajaveebitabel",yhendus); yhendus.Open(); SqlDataReader lugeja = kask.ExecuteReader(CommandBehavior.CloseConnection); Response.ContentType = "text/plain"; while (lugeja.Read()) { Response.Write(lugeja.GetString(0)+"\n"); } Response.End(); } }