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; using System.Configuration; public partial class aastasisestus4 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { SqlConnection yhendus = new SqlConnection(ConfigurationManager. ConnectionStrings["ConnectionString"].ConnectionString); yhendus.Open(); SqlCommand kask =new SqlCommand("SELECT min(aasta) FROM lennukid",yhendus); Label1.Text = kask.ExecuteScalar().ToString(); Label2.Text = new SqlCommand("SELECT max(aasta) FROM lennukid", yhendus). ExecuteScalar().ToString(); yhendus.Close(); } }