Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Formview returns to wrong record
Message
 
 
To
03/06/2008 15:09:14
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
01321324
Message ID:
01321394
Views:
10
>>>>>When adding a new record via a Formview control, the formview returns to the previous record rather than the new record. Is there a way to change this behavior so the formview will display the new record after saving a new record?
>>>>>
>>>>>Thanks
>>>>
>>>>Just guessing right now, because I usually just hide the info after I add it, but may be you can return the new ID as an output parameter if you're using SP?
>>>
>>>Well at the moment I'm just using the built in functionality of the FormView Update button. So far I don't know how to hook into the code that runs it.
>>
>>I think we were talking about Insert, not Update.
>>
>>Are you using SQLDataSource for your FormView? Are you using direct commands or SP?
>
>Yes, INSERT, sorry. :(
>I am using an SQLDataSource. There are no stored procedures. Just the built in buttons for INSERT, UPDATE etc. This is my first .NET experience.

May be I'm stirring you in the wrong direction, but I would try to create an INSERT SP instead that would return the inserted identity column as an output parameter.

Get MyGenerator for generating SP and lots of other goodies.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform