Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > SqlDataSource identity

Reply
Thread Tools

SqlDataSource identity

 
 
David C
Guest
Posts: n/a
 
      08-04-2008
I have a FormView that has an InsertCommand using a stored procedure (e.g.
"Exec sp_insTable @item1, etc...)
I have a ListBox also on the screen that is tied to the same table and has a
selected value of the ID of the FormView. When I use the FormView in INSERT
mode I would like to set the SelectedValue of the ListBox to the newly
inserted record on the FormView (is the IDENTITY value returned from the
sp). Is there a way to do this? Thanks.

David


 
Reply With Quote
 
 
 
 
Munna
Guest
Posts: n/a
 
      08-05-2008
Hi,

first of all you have to have a output parameter in your sp...
and in sp assign the @@identity to the output param

check out this post...

http://www.velocityreviews.com/forum...e-control.html


Best of luck

-------
Munna

www.munna.shatkotha.com/blog
www.munna.shatkotha.com
www.shatkotha.com
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
SQLDataSource and Identity column Vik ASP .Net 2 05-27-2009 03:17 PM
ASP.NET 2.0 Impersonation of fixed identity - truncation of identity JimLad ASP .Net 0 01-16-2009 10:42 AM
HttpContext.Current.User.Identity.Name AND Context.User.Identity.Name; nalbayo ASP .Net 2 11-11-2005 11:12 PM
Issue with Identity Impersonation and user identity used passed for trusted SQL connection. Frederick D'hont ASP .Net Security 0 07-25-2005 02:41 PM
Difference between HttpContext.Current.User.Identity and identity Impersonation Giovanni Bassi ASP .Net 0 10-20-2003 02:25 PM



Advertisments