protected void Page_Load(object sender, EventArgs e) { L_PublicUsr logi = new L_PublicUsr(); List <UEUPublic_User> data = null; data = logi.consultarPublicaciones(); GV_Comments.DataSource = data; GV_Comments.DataBind(); }
static string coonStr = "Data Source=.;Initial Catalog=M1;Persist Security Info=True;User ID=sa;Password="******"select * from T_Comments where GoodsId='" + L_GoodsId.Text + "' ", conn);//表为T_SaleItems DataTable dt1 = new DataTable(); SqlDataAdapter adp = new SqlDataAdapter(cmd); adp.Fill(dt1); GV_Comments.DataSource = dt1; GV_Comments.DataBind(); }
static string coonStr = "Data Source=.;Initial Catalog=M1;Persist Security Info=True;User ID=sa;Password="******"select * from T_Comments where Id='" + Session["userid"].ToString() + "' ", conn);//表为T_SaleItems DataTable dt1 = new DataTable(); SqlDataAdapter adp = new SqlDataAdapter(cmd); adp.Fill(dt1); GV_Comments.DataSource = dt1; GV_Comments.DataBind(); }
protected void GV_Comments_Page_Index_Changing(object sender, GridViewPageEventArgs e) { GV_Comments.PageIndex = e.NewPageIndex; GV_Comments.DataBind(); databind(); }