Returning Record ID Value

  • Thread starter Thread starter Kevin
  • Start date Start date
K

Kevin

Am very new at ASP.NET 2.0 and .NET!
Want to get the MembershipID from an inserted record using SqlDataSource:-
<InsertParameters>
<asp:Parameter Name="MembershipID" Direction="Output" Type="Int32"
DefaultValue="0" />
<asp:Parameter Name="FirstNames" Type="String" />
<asp:Parameter Name="LastNames" Type="String" />
</InsertParameters>

How can i get the MembershipID using VB??

Thanks
Kevin
 
Thanks for the help.

Have discovered and used:-
myID = e.Command.Parameters(0).Value.ToString

In the SqlDataSource1_Inserted event.

Kevin
 
You can also use a SELECT in the SP which pulls the @IDENTITY value, and
simply call any data method which executes a Stored Procedure and returns a
record set.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Show me your certification without works,
and I'll show my certification
*by* my works.
 
Back
Top