private void RefreshData() { var data = imsdb.Categories.OrderByDescending(br => br.Id).ToList(); GridViewCategory.DataSource = data; GridViewCategory.DataBind(); }
private void LoadData() { using (SqlConnection sqlconn = new SqlConnection(conStr)) { using (SqlCommand cmd = new SqlCommand()) { sqlconn.Open(); cmd.Connection = sqlconn; cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.CommandText = "getAllCategories"; SqlDataAdapter da = new SqlDataAdapter(cmd); DataTable dt = new DataTable(); da.Fill(dt); GridViewCategory.DataSource = dt; GridViewCategory.DataBind(); } } }
protected void Page_Load(object sender, EventArgs e) { try { if (Session["typeid"].ToString() != "1") { Response.Redirect("~/Login/Login.aspx"); } } catch (Exception) { Response.Redirect("~/Login/Login.aspx"); } if (!IsPostBack) { var data = imsdb.Categories.OrderByDescending(b => b.Id).ToList(); GridViewCategory.DataSource = data; GridViewCategory.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { string strCat = Convert.ToString(Request.QueryString["Value"]); LabelHeading.Text = strCat + " Details"; if (strCat == BRAND) { ErpDataContext db = new ErpDataContext(); GridViewCategory.DataSource = db.GetBrand(); GridViewCategory.DataBind(); } if (strCat == COLOR) { ErpDataContext db = new ErpDataContext(); GridViewCategory.DataSource = db.GetColor(); GridViewCategory.DataBind(); } if (strCat == SIZE) { ErpDataContext db = new ErpDataContext(); GridViewCategory.DataSource = db.GetSize(); GridViewCategory.DataBind(); } }
public void LoadCategory() { GridViewCategory.DataSource = categoryManger.GetAllCategory(); GridViewCategory.DataBind(); }
void PostCategory() { //GridView GridViewCategory = Article2.ContentPlaceholder.Controls[0].FindControl("GridViewCategory") as GridView; GridViewCategory.DataSource = ClassDataManager.CatgoryLoad(); GridViewCategory.DataBind(); }
private void updategrid() { GridViewCategory.DataBind(); }