|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Gridview update does not workI'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 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. -- Show quoteHide quote________________________ 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 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 > 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]
Menu Control Questions
CustomValidator points to wrong control ControlCollection.Remove bug Solution - Treeview Site Navigation without ShowExpandCollapse Radiobuttonlist (a custom control) selectedindexchanged event not firing in User Control Redirecting to another page operations on string DropDownList Refuses To Show New SelectedValue Data Grid Printing Getting data from templete TextBox |
|||||||||||||||||||||||