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