473,385 Members | 1,676 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Problems with updating 1 row in gridview

13
Hi. I have a problem with gridview whereby when i want to update 1 row, other row changes as well.

For example, i change the quantity in row 1 from 1 to 2, but when i click on update, other row's 'quantity' change to 2 as well. In the source code for this page, i add UpdateCommand="UPDATE [Order_Details] SET [Quantity] = @Quantity" under <asp: SqlDataSource>

Without UpdateCommand="UPDATE [Order_Details] SET [Quantity] = @Quantity", this error will be shown when i click on 'update' button >>>
Updating is not supported by data source 'SqlDataSourceShoppingCart' unless UpdateCommand is specified.

Please help...When i edit a row, i only want to update tht particular row and not every row in the gridview.

Many thanks.
Mar 22 '08 #1
2 1933
jeffstl
432 Expert 256MB
Hi. I have a problem with gridview whereby when i want to update 1 row, other row changes as well.

For example, i change the quantity in row 1 from 1 to 2, but when i click on update, other row's 'quantity' change to 2 as well. In the source code for this page, i add UpdateCommand="UPDATE [Order_Details] SET [Quantity] = @Quantity" under <asp: SqlDataSource>

Without UpdateCommand="UPDATE [Order_Details] SET [Quantity] = @Quantity", this error will be shown when i click on 'update' button >>>
Updating is not supported by data source 'SqlDataSourceShoppingCart' unless UpdateCommand is specified.

Please help...When i edit a row, i only want to update tht particular row and not every row in the gridview.

Many thanks.
You should research SQL a little more and table structure.

In order to update a single record your SQL has to specify that record using conditional WHERE clause.

Expand|Select|Wrap|Line Numbers
  1. UpdateCommand="UPDATE [Order_Details] SET [Quantity] = @Quantity WHERE QuantityID = " & RowQtyID & ""
  2.  
This is just an example of what you should have to update a single row.

For more on using SQL go here
http://www.w3schools.com/sql/default.asp
Mar 24 '08 #2
jhardman
3,406 Expert 2GB
Hey, is this an ASP question or an ASP.NET question? Just asking because usually ASP developers don't use the phrase "gridview"

Jared
Mar 25 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: | last post by:
Hello, Sorry to ask what is probably a simple answer, but I am having problems updating a table/database from a PHP/ PHTML file. I can Read From the Table, I can Insert into Table/Database, But...
0
by: H5N1 | last post by:
Hi there My problem is that in when I update GridView row, which is nested into DataList control, I want to refresh also DataList in which the GridView is nested, since after update, trigger in...
0
by: Loading name... | last post by:
hey asp.net 2.0 I have a GridView on my webpage which has its "enabling property" set to true. This gives a new column in the GridView with the text "Edit". I live in Norway and would like to...
1
by: =?Utf-8?B?UGV0ZXI=?= | last post by:
Hi folks, A web form has a DropDownList control and GridView control. Both are data binding. I expect that selecting an item in the DrowDownList will update the GridView visually. But, extra step...
10
by: =?Utf-8?B?bWljaGFlbCBzb3JlbnM=?= | last post by:
I understand how to connect a SqlDataSource to a GridView and have a nice data-connected, paginated web page generated with virtually no coding. Starting from that base, I would like to add an...
3
by: =?Utf-8?B?SmFtZXM=?= | last post by:
Hello, I'm trying to build a simple booking page. I have a Gridview and one of the columns is a Radiobuttonlist with the options Attending / Not Attending. This is bound to the field . This...
1
by: Durango2008 | last post by:
Hi, I am looking for a way to update a column of gridview fields based on the value of the first column, basically an auto-fill. I am able to get the value of the field I need however, I am not...
1
by: Jonathan Wood | last post by:
Greetings, On a GridView control, I want to show alternating colors. But instead of alternating on each row, I want to alternate each group. So several items would be one color and the next...
0
by: steve | last post by:
I have been fighting with trying to update a GridView for a while. I don't want to use the "built-in" way to do it because I am using business layer methods for updating and deleteing and I don't...
5
by: deepakthegeek | last post by:
I dont know if this kind of issue has been addressed earlier. I have a gridview control on a form, in the EditItem Template when a textbox is clicked, I have a popupcontrolextender displaying an...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.