void counts() { foreach(RepeaterItem items in repeat.Items) { HiddenField comment_like = (HiddenField)items.FindControl("comment_like"); Label user_counts = (Label)items.FindControl("user_counts"); if (Request.QueryString["id"] != null) { int id; id = Convert.ToInt32(Request.QueryString["id"].ToString()); con = new SqlConnection(str); con.Open(); cmd = new SqlCommand("sp_command_count", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@eid", id); cmd.Parameters.AddWithValue("@comment_id", comment_like.Value); da = new SqlDataAdapter(cmd); dt = new DataTable(); da.Fill(dt); con.Close(); if (dt.Rows.Count > 0) { DataRow dr = dt.Rows[0]; user_counts.Text = dr["total_count"].ToString() + "of" + dr["like_count"].ToString(); repeat.DataSource = dt; repeat.DataBind(); review_panel.Visible = true; } else { review_panel.Visible = false; } } } }
foreach
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)