using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data; using System.Data.Sql; using System.Data.SqlClient; public partial class trykk1 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { SqlConnection cn = new SqlConnection( "Data Source=.\\SQLEXPRESS;AttachDbFilename=|DataDirectory|\\Database.mdf;Integrated Security=True;User Instance=True"); SqlCommand cm = new SqlCommand( "SELECT koeranimi FROM koerad", cn); cn.Open(); SqlDataReader lugeja = cm.ExecuteReader( CommandBehavior.CloseConnection); while (lugeja.Read()) { Response.Write(lugeja.GetString(0)+"\n"); } // Response.Write("kuku"); } }