gridview edit mode question

Discussion in 'ASP .Net Web Controls' started by cheeseistheman, Jun 25, 2008.

  1. Hello there,

    I am fairly new to ASP.NET and have been using the data access tutorials at
    www.asp.net to get an understanding of some of the basic data access
    concepts. I have created a page that uses a detailsview to insert records
    into a table and a gridview to edit and delete existing records, so far so
    good.

    The one problem I have encountered that I have not figured out has to do
    with editing records. If another user inserts a record into the table before
    I click the edit button the gridview puts the wrong record in editmode ie.

    My gridview currently contains the records:

    200 Jones
    300 Peters
    400 Andrews

    Another user inserts the following record before I click edit:

    100 Walters

    I then click the edit button for the record that corresponds to "200 Jones"
    (which is the record I want to edit). Once I do this the gridview places the
    "100 Walters" record in edit mode. I'm sure I'm missing a faily basic concept
    here but if anyone has a suggestion for me I'd definitely appreciate it.
    Thanks.
    cheeseistheman, Jun 25, 2008
    #1
    1. Advertising

  2. does anyone know how to resolve this?????????????

    "cheeseistheman" wrote:

    > Hello there,
    >
    > I am fairly new to ASP.NET and have been using the data access tutorials at
    > www.asp.net to get an understanding of some of the basic data access
    > concepts. I have created a page that uses a detailsview to insert records
    > into a table and a gridview to edit and delete existing records, so far so
    > good.
    >
    > The one problem I have encountered that I have not figured out has to do
    > with editing records. If another user inserts a record into the table before
    > I click the edit button the gridview puts the wrong record in editmode ie.
    >
    > My gridview currently contains the records:
    >
    > 200 Jones
    > 300 Peters
    > 400 Andrews
    >
    > Another user inserts the following record before I click edit:
    >
    > 100 Walters
    >
    > I then click the edit button for the record that corresponds to "200 Jones"
    > (which is the record I want to edit). Once I do this the gridview places the
    > "100 Walters" record in edit mode. I'm sure I'm missing a faily basic concept
    > here but if anyone has a suggestion for me I'd definitely appreciate it.
    > Thanks.
    cheeseistheman, Jun 27, 2008
    #2
    1. Advertising

  3. cheeseistheman

    pendo Guest

    you have to limit to only updating the particular record. for instance in
    your wheree clauses say

    where primarykey = @primarykey

    "cheeseistheman" wrote:

    > does anyone know how to resolve this?????????????
    >
    > "cheeseistheman" wrote:
    >
    > > Hello there,
    > >
    > > I am fairly new to ASP.NET and have been using the data access tutorials at
    > > www.asp.net to get an understanding of some of the basic data access
    > > concepts. I have created a page that uses a detailsview to insert records
    > > into a table and a gridview to edit and delete existing records, so far so
    > > good.
    > >
    > > The one problem I have encountered that I have not figured out has to do
    > > with editing records. If another user inserts a record into the table before
    > > I click the edit button the gridview puts the wrong record in editmode ie.
    > >
    > > My gridview currently contains the records:
    > >
    > > 200 Jones
    > > 300 Peters
    > > 400 Andrews
    > >
    > > Another user inserts the following record before I click edit:
    > >
    > > 100 Walters
    > >
    > > I then click the edit button for the record that corresponds to "200 Jones"
    > > (which is the record I want to edit). Once I do this the gridview places the
    > > "100 Walters" record in edit mode. I'm sure I'm missing a faily basic concept
    > > here but if anyone has a suggestion for me I'd definitely appreciate it.
    > > Thanks.
    pendo, Jul 16, 2008
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John J Lee
    Replies:
    3
    Views:
    461
    bruno at modulix
    Dec 1, 2005
  2. Edward Loper
    Replies:
    0
    Views:
    451
    Edward Loper
    Aug 7, 2007
  3. Frank Kurka
    Replies:
    8
    Views:
    292
  4. Jaime Stuardo

    GridView control enters edit mode when I click Edit link twice

    Jaime Stuardo, Apr 7, 2006, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    383
    Jaime Stuardo
    Apr 7, 2006
  5. jobs at webdos
    Replies:
    0
    Views:
    451
    jobs at webdos
    Oct 9, 2006
Loading...

Share This Page