IT Community - Software Programming, Web Development and Technical Support

which method to use so that last inserted value can be retrieve.

This is a discussion on which method to use so that last inserted value can be retrieve. within the Database Support forums, part of the Web Development category; Dear all, i am using asp.net ,C# (VS 2005) and sql server 2005. i have written sp for inserting ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > Database Support

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 08-06-2007, 11:30 PM
KiruthikaSambandam KiruthikaSambandam is offline
D-Web Analyst
 
Join Date: Aug 2007
Posts: 332
KiruthikaSambandam is on a distinguished road
Default which method to use so that last inserted value can be retrieve.

Dear all,
i am using asp.net ,C# (VS 2005) and sql server 2005.
i have written sp for inserting the the data which written last inserted idendity no.
i would like to which method should i use(reader , nonexecutequery or executescalar ) so that i get that value and display the value in the form.

Thnx
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 08-07-2007, 12:13 AM
S.Vinothkumar S.Vinothkumar is offline
D-Web Genius
 
Join Date: May 2007
Posts: 1,061
S.Vinothkumar is on a distinguished road
Default Re: which method to use so that last inserted value can be retrieve.

Use ExecuteScalar ....
__________________
S.VinothkumaR
Behind me is infinite power,
Before me is Endless Possibility,
Around me is Boundless Opportunity,
Why should I fear!
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Retrieve only the Nth row from a table? santhakumar Database Support 6 11-14-2008 05:12 AM
How to Retrieve a Cookie Value? sundarraja PHP Programming 4 04-02-2008 07:00 AM
Autoplay When USB is inserted using C# Anandavinayagam C# Programming 3 10-03-2007 03:53 AM
How do I retrieve the values from the URL? Pvinothkumar HTML, CSS and Javascript Coding Techniques 1 09-13-2007 06:30 AM
Get a inserted record field value in PHP-mySQL venkat_charya PHP Programming 0 08-24-2007 09:52 AM


All times are GMT -7. The time now is 03:33 AM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0