Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

getting value of Data table datacolumn identity

Status
Not open for further replies.

jpack23

Programmer
Dec 15, 2004
82
US
Here is my stored proc

[dbo].[pInsertActivity]
(
@ActivityID int,
@Location int,
@LocationID int,
@Notes varchar(5000)
)
AS
SET NOCOUNT OFF;
INSERT INTO [Activity].[tblActivities]
(
[ActivityID],
[Location],
[LocationID],
[Notes]
)
VALUES
(
@ActivityID,
@Location,
@LocationID,
@Notes
)

select @@identity as fldIdentity

here is my vb code

Public Sub Save()

TableAdapterCreate().Update(dataTable:=Me)

End Sub

Private Function TableAdapterCreate() As ActivityTableAdapter

Dim TA As New ActivityTableAdapter


TA.Connection.ConnectionString = My.Settings.ConnectionString

Return TA
End Function

I want to get the @@Identity value for use elsewhere in my post....not sure how to do that. I noticed that the Me datatable has columns and one of the colums is me.fldIdentity. How can I get the value of that so I can use it later in my project.

thanks for your help

joe
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top