NigelRocks
asked on
Can't Update GridView
I have a GridView bound to a SQL Server DataSource. All the data renders from that souce into the bound grid. I've made the grid editable, so when I hit "Edit", the one field I want to be edited is enabled. When I put in the new value and hit update, absolultely nothing happens.
The attached file shows my update query. There's not much to it. I map the "Quantity" field in the grid to the "QUantity" field in the database. When I hit "execute query", the value I put in manually in this window indeed DOES get written to the database. However, when I update a single row, not only does that value not get written to all rows (as in my test), but nothing gets updated anywhere.
I'm almost there. What grand avatar can guide me to the ever-elusive grail of actually being able to update a datasource?
Image.jpg
The attached file shows my update query. There's not much to it. I map the "Quantity" field in the grid to the "QUantity" field in the database. When I hit "execute query", the value I put in manually in this window indeed DOES get written to the database. However, when I update a single row, not only does that value not get written to all rows (as in my test), but nothing gets updated anywhere.
I'm almost there. What grand avatar can guide me to the ever-elusive grail of actually being able to update a datasource?
Image.jpg
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
The attached image shows my settings in the query window. What am I missing?
Image.jpg
Image.jpg
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
The actual problem was that I had a DataBind() method being called on postback. This loaded the old data back into the grid. Once I took it out, the grid was updated without a problem.
Glad you found the source of the issue and were able to resolve it.
ASKER