private void bind()
{
ListBox1.DataSource = lst;
ListBox1.DataBind();
ListBox1.DataValueField = (lst[0].propertyid).ToString();
TextBox6.Text = lst[0].ToString();
Image1.ImageUrl = "~/Landpics" + lst[3].Pimage.ToString();
TextBox8.Text = (lst[2].sqrft).ToString();
TextBox9.Text = lst[3].propertytype.ToString();
TextBox10.Text = lst[4].location.ToString();
TextBox7.Text = lst[1].priceland.ToString();
}
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
bind();
}
}
//and my 3 tier coding is as follows=====
public List<clslandprp> dspland(clslandprp r)
{
SqlCommand cmd = new SqlCommand("dspland", con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@propertyid", SqlDbType.Int).Value = Convert.ToInt32(r.propertyid);
if (con.State == ConnectionState.Closed)
{
con.Open();
}
SqlDataReader dr = cmd.ExecuteReader();
List<clslandprp> lst = new List<clslandprp>();
if (dr.HasRows)
{
dr.Read();
clslandprp k = new clslandprp();
k.priceland = Convert.ToInt32(dr[1]);
k.sqrft = Convert.ToInt32(dr[2]);
k.Pimage = dr[3].ToString();
k.propertytype = dr[4].ToString();
k.location = dr[5].ToString();
lst.Add(k);
}
cmd.Dispose();
con.Close();
return lst;
}
please provide me some idea how to do it..
it is not giving me .. the desired result..
i want all the things to be displayed in the user interface