protected void Page_Load(object sender, EventArgs e) { DataAccessLayer dao = new DataAccessLayer(); SqlDataReader reader = dao.GetAllUsers(); Repeater1.DataSource = reader; Repeater1.DataBind(); }
protected void loadHTML() { DataAccessLayer dao = new DataAccessLayer(); try { SqlDataReader reader = dao.GetAllUsers(); Response.Write("<ol class='breadcrumb mb-4' style='margin-top:20px;'>"); Response.Write("<li class='breadcrumb-item active'>Users</li>"); Response.Write("</ol>"); Response.Write("<div class='container-fluid'>"); Response.Write("<div class='table-responsive'>"); Response.Write("<table class='table'>"); Response.Write("<thead class='thead-dark'>"); Response.Write("<tr>"); Response.Write("<th scope='col'>Name</th>"); Response.Write("<th scope='col'>Email / Username</th>"); Response.Write("<th scope='col'>Phone</th>"); Response.Write("<th scope='col'>Update</th>"); Response.Write("</tr>"); Response.Write("</thead>"); Response.Write("<tbody>"); while (reader.Read()) { // userID = reader.GetInt32(0); // userType = reader.GetByte(1); // userName = reader.GetString(2); // userMobile = reader.GetString(3); // userPassword = reader.GetString(4); // userEmail = reader.GetString(5); // userFb = reader.GetString(6); // userLinkedin = reader.GetString(7); // userTwitter = reader.GetString(8); // userDescription = reader.GetString(9); // userSkype = reader.GetString(11); // userImage = reader.Getint32(12); Response.Write("<tr>"); Response.Write("<td>" + reader.GetString(2) + "</td>"); Response.Write("<td>" + reader.GetString(5) + "</td>"); Response.Write("<td>" + reader.GetString(3) + "</td>"); Response.Write("<td><a class='btn btn-primary' href='UpdateUser.aspx?id=" + reader.GetInt32(0) + "' role='button'>Update</a></td>"); Response.Write("</tr>"); } Response.Write("</tbody>"); Response.Write("</table>"); Response.Write("</div>"); Response.Write("</div>"); } catch (System.NullReferenceException r) { //exception handling } }
protected void Page_Load(object sender, EventArgs e) { DataAccessLayer dao = new DataAccessLayer(); SqlDataReader reader = dao.GetAllFeaturedProperties(); Repeater1.DataSource = reader; Repeater1.DataBind(); reader.Close(); SqlDataReader reader2 = dao.GetAllProperties(Constants.propertyEnabled); Repeater2.DataSource = reader2; Repeater2.DataBind(); reader2.Close(); SqlDataReader reader3 = dao.GetAllUsers(); Repeater3.DataSource = reader3; Repeater3.DataBind(); reader3.Close(); }