private void BindCommentData(int PageIndex) { DataTable dt = commentBll.GetList(AppType.Product, ProductID); Literal_CommentCount.Text = dt.Rows.Count.ToString(); Repeater_Comments.DataSource = dt; Repeater_Comments.DataBind(); }
private void repeaterComments() { SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ToString()); SqlCommand cmd = new SqlCommand(); cmd.Connection = conn; cmd.CommandText = "SELECT * FROM Coments INNER JOIN Users ON fk_users = user_id WHERE fk_news = @fk_news"; cmd.Parameters.AddWithValue("@fk_news", Request.QueryString["news_id"].ToString()); conn.Open(); SqlDataReader reader = cmd.ExecuteReader(); Repeater_Comments.DataSource = reader; Repeater_Comments.DataBind(); }