Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Update trouble.

Author  Topic 

Osama
Starting Member

5 Posts

Posted - 2008-10-23 : 02:43:54
Hi all..

I have a gridview control and an SQLDatasource on an asp.net page

datasource select statement:

SELECT UserId, UserName, CompanyName, CompanyRegion, ContactPerson, Email, LastActivityDate

FROM aspnet_Users

WHERE (UserName = @username)

datasource update statement :

UPDATE aspnet_Users

SET UserName =@un, CompanyName =@cn, CompanyRegion =@cr, ContactPerson =@cp, Email =@email

WHERE (UserId = @Original_UserId)



When i click edit in the gridview and modify a value , then click update .. the grid view is refrshed but the value isnt changed.


any idea why?

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-10-23 : 02:59:26
Are you passing down value of @Original_UserId from page while clicking on update?
Go to Top of Page

rammohan
Posting Yak Master

212 Posts

Posted - 2008-10-23 : 02:59:43
instead of WHERE (UserId = @Original_UserId)

use

where UserId = @UserId

One can never consent to creep,when one feels an impulse to soar
RAMMOHAN

Go to Top of Page
   

- Advertisement -