Returning Record ID Value

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
 
K

Kevin

Thanks for the help.

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

In the SqlDataSource1_Inserted event.

Kevin
 
K

Kevin Spencer

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,008
Latest member
HaroldDark

Latest Threads

Top