Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > gridview edit mode question

Reply
Thread Tools

gridview edit mode question

 
 
cheeseistheman
Guest
Posts: n/a
 
      06-25-2008
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.
 
Reply With Quote
 
 
 
 
cheeseistheman
Guest
Posts: n/a
 
      06-27-2008
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.

 
Reply With Quote
 
 
 
 
pendo
Guest
Posts: n/a
 
      07-16-2008
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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
GridView control enters edit mode when I click Edit link twice Jaime Stuardo ASP .Net Web Controls 0 04-07-2006 12:47 AM
GridView edit validation, edit dropdown list, delete popup confirm =?Utf-8?B?a2Vu?= ASP .Net 1 01-23-2006 12:51 PM
Snapshot restraint - edit, edit, edit Alan Browne Digital Photography 24 05-10-2005 10:15 PM
Snapshot restraint - edit, edit, edit Patrick Digital Photography 0 05-06-2005 10:53 PM
Would like to load a datagrid already in edit mode instead of having the user click the edit button Frank Kurka ASP .Net Datagrid Control 8 04-29-2005 09:33 AM



Advertisments