A
arne
How do I capture a resultset from a stored procedure with
ado.net code?
ALTER PROCEDURE dbo.sp_ins_contacts
(
@FName nvarchar(50),
@LName nvarchar(50),
@Initials nvarchar(50),
@IntakeDate smalldatetime,
@SSN nchar(10),
@Advisor nvarchar(50 )
AS
SET NOCOUNT OFF;
INSERT INTO tbl_Contacts(FName, LName, Initials,
IntakeDate, SSN, Advisor) VALUES (@FName, @LName,
@Initials, @IntakeDate, @SSN, @Advisor);
SELECT ContactID, FName, LName, Initials,
IntakeDate, SSN, Advisor FROM tbl_Contacts WHERE
(ContactID = @@IDENTITY)
ado.net code?
ALTER PROCEDURE dbo.sp_ins_contacts
(
@FName nvarchar(50),
@LName nvarchar(50),
@Initials nvarchar(50),
@IntakeDate smalldatetime,
@SSN nchar(10),
@Advisor nvarchar(50 )
AS
SET NOCOUNT OFF;
INSERT INTO tbl_Contacts(FName, LName, Initials,
IntakeDate, SSN, Advisor) VALUES (@FName, @LName,
@Initials, @IntakeDate, @SSN, @Advisor);
SELECT ContactID, FName, LName, Initials,
IntakeDate, SSN, Advisor FROM tbl_Contacts WHERE
(ContactID = @@IDENTITY)