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 kakstabelit : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } public String kysiTyybiNimetus(int tyybiID) { SqlConnection yhendus = new SqlConnection(ConfigurationManager.ConnectionStrings["yhendus1"].ConnectionString); yhendus.Open(); SqlCommand kask = new SqlCommand("SELECT nimetus FROM tyyp WHERE id=@id",yhendus); kask.Parameters.AddWithValue("@id", tyybiID); return kask.ExecuteScalar() as String; } }