public void ShowMyData() { try { //Open connection conn.Open(); //command cmd = new SqlCommand(sqlsel, conn); //ExecuteReader() returns a data reader (read rows) rdr = cmd.ExecuteReader(); RepeaterTreatment.DataSource = rdr; RepeaterTreatment.DataBind(); } catch (Exception ex) { //error handling LabelMessage.Text = ex.Message; } finally { //Close conn conn.Close(); } }
public void ShowMyData() { try { conn.Open(); cmd = new SqlCommand(sqlsel, conn); rdr = cmd.ExecuteReader(); RepeaterTreatment.DataSource = rdr; RepeaterTreatment.DataBind(); } catch (Exception ex) { LabelMessage.Text = ex.Message; } finally { conn.Close(); } }
protected void Page_Load(object sender, EventArgs e) { RepeaterTreatment.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { RepeaterTreatment.DataBind(); //LabelMessage.Text = Session["email"].ToString(); LabelMessage.Text = "Everything looks good. No errors to worry about.. :)"; }