473,471 Members | 1,715 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Returning Record ID Value

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
Apr 2 '06 #1
3 1172
http://www.devx.com/vb2themax/Tip/18893
"Kevin" <ke*****@tesco.net> wrote in message
news:OG**************@TK2MSFTNGP14.phx.gbl...
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

Apr 3 '06 #2
Thanks for the help.

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

In the SqlDataSource1_Inserted event.

Kevin

"Stuart Irving" <sp**@stuartirving.net> wrote in message
news:uE****************@TK2MSFTNGP10.phx.gbl...
http://www.devx.com/vb2themax/Tip/18893
"Kevin" <ke*****@tesco.net> wrote in message
news:OG**************@TK2MSFTNGP14.phx.gbl...
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


Apr 3 '06 #3
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.

"Kevin" <ke*****@tesco.net> wrote in message
news:Op*************@TK2MSFTNGP10.phx.gbl...
Thanks for the help.

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

In the SqlDataSource1_Inserted event.

Kevin

"Stuart Irving" <sp**@stuartirving.net> wrote in message
news:uE****************@TK2MSFTNGP10.phx.gbl...
http://www.devx.com/vb2themax/Tip/18893
"Kevin" <ke*****@tesco.net> wrote in message
news:OG**************@TK2MSFTNGP14.phx.gbl...
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



Apr 3 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Sugapablo | last post by:
Let's say I create a new record in a table like this: mysql_query("INSERT INTO table (col1) VALUES ('example')",$conn); ....that had an auto-incrementing, unique identifying column named "ID"...
1
by: Ben | last post by:
I have a Tabular form bound to a table. The purpose of this form is to get times from a timer and record them in a field. The timer dumps the time automatically through a serial port. When the time...
6
by: Ted Stewart | last post by:
I've got a table with an autogenerated number as it's primary key, which is being accessed by an external .NET app. When the app inserts a new record into the table, is there any way to return the...
1
by: john | last post by:
Relatively new to C coding, so any help would greatly be appreciated. I'm having problems try to return my string array from my parsing function. When I do a printf I am getting the correct value...
5
by: Paul Aspinall | last post by:
Hi I have a Stored Proc in SQL server, which creates a record key when a record is created. I want to return the value back to my code, once the record has been created. I am using SQLHelper...
5
by: Robert Fitzpatrick | last post by:
Can someone point me to some more information or perhaps show an example of returning a recordset from a plpgsql function. I'd like to send an argument or arguments to the function, do some queries...
4
by: scparker | last post by:
Hello, We have a stored procedure that does a basic insert of values. I am then able to retrieve the ID number created for this new record. We are currently using ASP.NET 2.0 and use N-Tier...
6
by: student1976 | last post by:
All Beginner/Intermediate level question. I understand that returning ptr to local stack vars is bad. Is returning foo_p_B from fnB() reliable all the time, so that using foo_p_A does not...
5
by: littlevikinggirl | last post by:
Hi, I posted a badly worded question last week so got no replies and am still struggling to figure out the problem myself. I have a table containing two fields, Location and Serial Number. I...
5
natalie99
by: natalie99 | last post by:
Hi everyone I have a small problem, which is making it impossible to acheive my db aims! I would like to know how to write a query that will tell me if a field item is in IN another table,...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.