Let your gridview do things that it knows how to do well. Update one record
in the time in a regular way, but do it against a temporary datasource as
opposed to the real database table. Then, on the save click, dump all
updated records from the datasource to the database.

Signature
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
>I want to have a gridview where the user can enter/edit/delete records and
>when they are finally done, I will write out the records to the database
[quoted text clipped - 4 lines]
>
> TIA - Jeff.
Mufasa - 14 Jan 2008 20:14 GMT
When you say 'do it against a temporary datasource' how would I go about
doing that? Ideally it would just be in memory - no need to assign it
anywhere until I'm done with it.
The only things I've seen where you do update/inserts you assign the
datasource to a source in the aspx page.
TIA - Jeff.
> Let your gridview do things that it knows how to do well. Update one
> record in the time in a regular way, but do it against a temporary
[quoted text clipped - 9 lines]
>>
>> TIA - Jeff.
Eliyahu Goldin - 15 Jan 2008 13:35 GMT
Don't use declarative databinding with DataSourceID property. Use the
DataSource property and call DataBind method explicitly. The datasource can
be an instance of the DataTable class, or an ArrayList or any other
collection object.
You can make a strictly-typed dataset in design time, the designer will
created also a TableAdapter for updating data. In run-time, get it populated
from the database, databind to the grid and your updates will run against
the DataTable in the dataset. The dataset is a memory object, nothing will
go to the database until you call myTableAdapter.Update()..

Signature
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
> When you say 'do it against a temporary datasource' how would I go about
> doing that? Ideally it would just be in memory - no need to assign it
[quoted text clipped - 18 lines]
>>>
>>> TIA - Jeff.