public void ShowMyData() { try { conn.Open(); cmd = new SqlCommand(sqlsel, conn); rdr = cmd.ExecuteReader(); RepeaterIndoor.DataSource = rdr; RepeaterIndoor.DataBind(); } catch (Exception ex) { LabelMessage.Text = ex.Message; } finally { conn.Close(); } }
protected void Page_Load(object sender, EventArgs e) { RepeaterIndoor.DataBind(); sqlsel = "select * from Item where Selection_Id=1"; ShowMyData(); }