Based on the Key-Value pair in the URL, I'm searching my DetailsView. The SELECT command for my DetailsView is as below
SELECT ID, JobNo, CellNo, MailDate, Status
FROM Table_1
WHERE (JobNo=@JobNo)
I'm passing the JobNo value through Query String as JobNo=Request.QueryString("JobNo")
So the above given SELECT is working & thereby search is working fine. The problem arises when I try to EDIT the fields by clicking on EDIT link. The Update never works, whenever I click on UPDATE button after making my changes, it reverts back to the Original
Data in the fields as if I never made any editing at all.
The UPDATE command is as below,
UPDATE Table_1
SET CellNo=@CellNo, MailDate=@MailDate, Status=@Status
WHERE ID=@ID
ID is the PRIMARY KEY in this table and I'm using SQL SERVER. Please help me out
chetanom
0 Points
9 Posts
Update not working in DetailsView after Search using Key-Value Pair in the URL
Apr 26, 2012 12:59 AM|LINK
I have a URL as below,
http://localhost:1637/Website1/Customer.aspx?JobNo=1234
Based on the Key-Value pair in the URL, I'm searching my DetailsView. The SELECT command for my DetailsView is as below
SELECT ID, JobNo, CellNo, MailDate, Status
FROM Table_1
WHERE (JobNo=@JobNo)
I'm passing the JobNo value through Query String as JobNo=Request.QueryString("JobNo")
So the above given SELECT is working & thereby search is working fine. The problem arises when I try to EDIT the fields by clicking on EDIT link. The Update never works, whenever I click on UPDATE button after making my changes, it reverts back to the Original Data in the fields as if I never made any editing at all.
The UPDATE command is as below,
UPDATE Table_1
SET CellNo=@CellNo, MailDate=@MailDate, Status=@Status
WHERE ID=@ID
ID is the PRIMARY KEY in this table and I'm using SQL SERVER. Please help me out