Home All Groups Group Topic Archive Search About
Author
3 Nov 2006 3:02 PM
dbronstein88
I'm using ASP.NET 2.0.  I created a table adapter using basic select,
insert, update, delete stored procedures.  I created an object
datasource and bound it to the table adapter.  I created a GridView and
bound it to the data source.  The delete works just fine but the
Edit/Update does not work.  You click on Edit and it puts the record
into edit mode.  You make your changes and then when you click Update
the changes are not saved.

I created a FormView and bound it to the same datasource.  The update
on the formview works fine, so it's clearly a problem with the
Gridview.  Has anyone seen this before and is there a fix or workaround
for it (other than having to create something completely separate to do
the updates)?

Thanks,
Joe

Author
9 Nov 2006 11:56 PM
Alvin Bruney [MVP]
wow,  you got too much stuff going on. Bind the gridview to the database. It
will automatically create a datasource object. that is all u need.

--
________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
-------------------------------------------------------


<dbronstei***@yahoo.com> wrote in message
Show quoteHide quote
news:1162566120.222896.100320@b28g2000cwb.googlegroups.com...
> I'm using ASP.NET 2.0.  I created a table adapter using basic select,
> insert, update, delete stored procedures.  I created an object
> datasource and bound it to the table adapter.  I created a GridView and
> bound it to the data source.  The delete works just fine but the
> Edit/Update does not work.  You click on Edit and it puts the record
> into edit mode.  You make your changes and then when you click Update
> the changes are not saved.
>
> I created a FormView and bound it to the same datasource.  The update
> on the formview works fine, so it's clearly a problem with the
> Gridview.  Has anyone seen this before and is there a fix or workaround
> for it (other than having to create something completely separate to do
> the updates)?
>
> Thanks,
> Joe
>
Author
16 Nov 2006 4:54 PM
Joe
Our standards are to use stored procedures for all db access. Anyway,
it doesn't matter because that's not the problem.  The problem is with
the griview because the formview works just fine.

I did some playing around and I created a class and bound the
datasource to the class.  On an unpdate, the gridview is passing the
old value, not the new value.  So it's definitely an issue with the
gridview.


Alvin Bruney [MVP] wrote:
Show quoteHide quote
> wow,  you got too much stuff going on. Bind the gridview to the database. It
> will automatically create a datasource object. that is all u need.
>
> --
> ________________________
> Warm regards,
> Alvin Bruney [MVP ASP.NET]