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. Advertisements

  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. Advertisements

  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. Advertisements

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. =?Utf-8?B?UGxheW1ha2Vy?=
    Replies:
    2
    Views:
    3,526
    =?Utf-8?B?UGxheW1ha2Vy?=
    Aug 8, 2005
  2. Michael
    Replies:
    2
    Views:
    6,478
    Michael
    Nov 9, 2005
  3. =?Utf-8?B?a2Vu?=
    Replies:
    1
    Views:
    10,706
    Wiktor Zychla [C# MVP]
    Jan 23, 2006
  4. John J Lee
    Replies:
    3
    Views:
    818
    bruno at modulix
    Dec 1, 2005
  5. Edward Loper

    mmm-mode, python-mode and doctest-mode?

    Edward Loper, Aug 9, 2007, in forum: Python
    Replies:
    0
    Views:
    653
    Edward Loper
    Aug 9, 2007
  6. Frank Kurka
    Replies:
    8
    Views:
    636
  7. 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:
    671
    Jaime Stuardo
    Apr 7, 2006
  8. jobs at webdos
    Replies:
    0
    Views:
    812
    jobs at webdos
    Oct 9, 2006
Loading...