M
M. Ali Qureshi
Hi,
I have following stored procedure that should return @UserID.
=======================
CREATE PROCEDURE [dbo].[CreateUserProfile]
@UserType int,
@BusinessStatus int,
@BusinessBranch int,
@BusinessForm int,
@BusinessType int,
@TotalEmployees nvarchar(50),
@TurnOver nvarchar(50)
AS
BEGIN
declare @UserID as int
SET NOCOUNT ON;
INSERT into Users (UserTypeID, BusinessStatusID, BusinessBranchID,
BusinessFormID, BusinessTypeID, TotalEmployees, TurnOver, Status)
values (@UserType, @BusinessStatus, @BusinessBranch, @BusinessForm,
@BusinessType, @TotalEmployees, @TurnOver, 0)
SELECT @UserID = scope_identity()
END
========================
I added the stored procedure in the table adapter, and called it through a
function in BLL class file.
When i run the stored procedure through an aspx page, i get only "0" value
back. Here is the code from aspx page.
======================
If Not HasError Then
Dim UserAdapter As New DBAccessBLL
Dim UserID As Integer
UserID = UserAdapter.InsertUserProfile(UserType.SelectedValue,
BusinessStatus.SelectedValue, BusinessBranch.SelectedValue,
BusinessForm.SelectedValue, BusinessType.SelectedValue, _Employees,
_TurnOver)
Response.Redirect("Start.aspx?u=" & UserID.ToString())
End If
=======================
What am i doing wrong? Could anyone please help me please?
Thanks alot.
I have following stored procedure that should return @UserID.
=======================
CREATE PROCEDURE [dbo].[CreateUserProfile]
@UserType int,
@BusinessStatus int,
@BusinessBranch int,
@BusinessForm int,
@BusinessType int,
@TotalEmployees nvarchar(50),
@TurnOver nvarchar(50)
AS
BEGIN
declare @UserID as int
SET NOCOUNT ON;
INSERT into Users (UserTypeID, BusinessStatusID, BusinessBranchID,
BusinessFormID, BusinessTypeID, TotalEmployees, TurnOver, Status)
values (@UserType, @BusinessStatus, @BusinessBranch, @BusinessForm,
@BusinessType, @TotalEmployees, @TurnOver, 0)
SELECT @UserID = scope_identity()
END
========================
I added the stored procedure in the table adapter, and called it through a
function in BLL class file.
When i run the stored procedure through an aspx page, i get only "0" value
back. Here is the code from aspx page.
======================
If Not HasError Then
Dim UserAdapter As New DBAccessBLL
Dim UserID As Integer
UserID = UserAdapter.InsertUserProfile(UserType.SelectedValue,
BusinessStatus.SelectedValue, BusinessBranch.SelectedValue,
BusinessForm.SelectedValue, BusinessType.SelectedValue, _Employees,
_TurnOver)
Response.Redirect("Start.aspx?u=" & UserID.ToString())
End If
=======================
What am i doing wrong? Could anyone please help me please?
Thanks alot.