public partial class Default4 : System.Web.UI.Page { adhousetier.clshouseinfo obj = new adhousetier.clshouseinfo(); adhousetier.clsfxnhouse objfxn = new adhousetier.clsfxnhouse(); List<adhousetier.clshouseinfo> objlst = new List<adhousetier.clshouseinfo>(); private void bind() { objlst = objfxn.dspkitchen(obj); GridView1.DataSource = objlst; GridView1.DataBind(); } protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { bind(); } } } public List<clshouseinfo> dspkitchen(clshouseinfo r) { SqlCommand cmd = new SqlCommand("dspkitchen", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@kitchenid", SqlDbType.Int).Value = r.kitchenid; if (con.State == ConnectionState.Closed) { con.Open(); } List<clshouseinfo> lst = new List<clshouseinfo>(); SqlDataReader dr = cmd.ExecuteReader(); if (dr.HasRows) { dr.Read(); clshouseinfo k = new clshouseinfo(); k.image = dr[1].ToString(); k.price = Convert.ToInt32(dr[2]); lst.Add(k); } cmd.Dispose(); con.Close(); return lst; }</clshouseinfo></clshouseinfo></clshouseinfo>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)