Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
J

jpmadeira

@jpmadeira
About
Posts
2
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Web Parent Control
    J jpmadeira

    Try www.google.com

    I'm a Worm Bug ;)

    ASP.NET question

  • Gridview problem
    J jpmadeira

    I'm having a lot of problems with the gridview bind. I have a dataset that represents a table of a database. When I delete or insert a row in the gridview I have the data well inserted or deleted in the db but the gridview duplicates the rows when postbacks the page and i can't understand why. Can someone help me? Code aspx.cs: protected void Page_Load(object sender, EventArgs e) { dbHandler = new WalletManagerDBSqlSrvHandler(DB_SERVER); shoptype_grid.DataSource = dbHandler.getShopTypes().Tables["ShopType"]; if (!Page.IsPostBack) { shoptype_grid.DataBind(); } formatShopTypeGrid(); } //eventhandler when a row is inserted protected void onClickInsertShopType(object sender, EventArgs e) { DataTable dtable = dbHandler.getShopTypes().Tables["ShopType"]; DataRow dataRow = dtable.NewRow(); dataRow["ID"] = DateTime.UtcNow.Ticks; /*Generates the ID of the inserted item threw the date and time tick*/ dataRow["Type"] = shopType_txtbox.Text; dtable.Rows.Add(dataRow); dbHandler.updateShopType(DatabaseOperation.Insert); shoptype_grid.DataBind(); } //eventhandler when a row is deleted protected void shoptype_grid_RowDeleting(object sender, GridViewDeleteEventArgs e) { DataTable dtable = dbHandler.getShopTypes().Tables["ShopType"]; DataRow drow = dtable.Rows[e.RowIndex]; drow.Delete(); //row erased dbHandler.updateShopType(DatabaseOperation.Delete); shoptype_grid.DataBind(); }

    I'm a Worm Bug ;)

    ASP.NET help database question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups