how to returning a table id..

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default how to returning a table id..

    hiye, i use sqlcommand.executescalar to insert datainto
    my table hoping that it will return the table id, but its
    not :(. can someone uot there tell mehows its done?

    thanks in advance.
    smen Guest

  2. Similar Questions and Discussions

    1. #25473 [Opn->Bgs]: Updating single row in table causing all rows in table to be updated.
      ID: 25473 Updated by: sniper@php.net Reported By: jim at bluedojo dot com -Status: Open +Status: ...
    2. #25473 [Opn->Fbk]: Updating single row in table causing all rows in table to be updated.
      ID: 25473 Updated by: sniper@php.net Reported By: jim at bluedojo dot com -Status: Open +Status: ...
    3. #25473 [Opn]: Updating single row in table causing all rows in table to be updated.
      ID: 25473 User updated by: jim at bluedojo dot com Reported By: jim at bluedojo dot com Status: Open Bug Type: ...
    4. #25473 [NEW]: Updating single row in table causing all rows in table to be updated.
      From: jim at bluedojo dot com Operating system: WinXP PHP version: 4.3.3 PHP Bug Type: MySQL related Bug description: ...
    5. Could not load type VTFixup Table from assembly Invalid token in v-table fix-up table.
      We are getting this error after clearing the web.config of database infomation - even after using the wizard to re-enter the information. I could...
  3. #2

    Default Re: how to returning a table id..

    assuming this table id is an IDENTITY field

    CREATE Procedure spAddSomething
    (
    @SSNO char(9),
    @FirstName nvarchar(15),
    @MidName nvarchar(15),
    @LastName nvarchar(25)
    )

    AS

    INSERT tblWhatever (
    SSNO,
    FirstName,
    MidName,
    LastName
    ) Values (
    @SSNO,
    @FirstName,
    @MidName,
    @LastName
    )

    SELECT @@IDENTITY AS 'Table_ID'

    GO

    Hope this helps

    Shane

    "smen" <scht80@hotmail.com> wrote in message
    news:019801c35ecd$35123c40$a501280a@phx.gbl...
    > hiye, i use sqlcommand.executescalar to insert datainto
    > my table hoping that it will return the table id, but its
    > not :(. can someone uot there tell mehows its done?
    >
    > thanks in advance.

    SStory Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139