protected void Page_Load(object sender, EventArgs e)
{
string sqlcmd;
sqlcmd = "select * from userinfo";
Repeater1.DataSource = userSql.db.ExecuteDataview(sqlcmd);
Repeater1.DataBind();
}
protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
((Label)e.Item.FindControl("Label1")).Text = ((DataRowView)e.Item.DataItem).Row["Username"].ToString() + "<br />";
string sqlcmd;
string k;
k = ((DataRowView)e.Item.DataItem).Row["Username"].ToString();
sqlcmd = "select * from BlogArticle where username = @Username";
SqlParameter[] param = {
new SqlParameter("Username",k),
};
Repeater Repeater2 = (Repeater)e.Item.FindControl("Repeater2");
Repeater2.DataSource = userSql.db.ExecuteDataview(sqlcmd, param);
Repeater2.DataBind();
}
{
string sqlcmd;
sqlcmd = "select * from userinfo";
Repeater1.DataSource = userSql.db.ExecuteDataview(sqlcmd);
Repeater1.DataBind();
}
protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
((Label)e.Item.FindControl("Label1")).Text = ((DataRowView)e.Item.DataItem).Row["Username"].ToString() + "<br />";
string sqlcmd;
string k;
k = ((DataRowView)e.Item.DataItem).Row["Username"].ToString();
sqlcmd = "select * from BlogArticle where username = @Username";
SqlParameter[] param = {
new SqlParameter("Username",k),
};
Repeater Repeater2 = (Repeater)e.Item.FindControl("Repeater2");
Repeater2.DataSource = userSql.db.ExecuteDataview(sqlcmd, param);
Repeater2.DataBind();
}