using this code.stored procedure
@_Empno nvarchar(8),@_Surname nvarchar(50),
@_Firstname nvarchar(50),
@_Middlenamenvarchar(50),@_PermanentAdd nvarchar(Max),
@_PresentAdd nvarchar(Max),
@_Identity ouput int
AS
SET NOCOUNT ON;
INSERT INTO TblEmpPersonal
(
Empno,
Surname,
Firstname,
Middlename,
PermanentAdd)
values(INSERT INTO TblEmpPersonal
(
@_Empno,
@_Surname,
@_Firstname,
@_Middlename,
@_PermanentAdd)
set @_Identity = (Select cast(scope_identity() as int) as empID)
here my DAL
public static bool Create(IEmployee Emp)
{
SqlParameter[] _parameters = {
new SqlParameter("@_Empno", Emp.Empno),
new SqlParameter("@_Surname",Emp.Surname),
new SqlParameter("@_Firstname", Emp.Firstname),
new SqlParameter("@_Middlename",Emp.Middlename),
new SqlParameter("@_PermanentAdd",Emp.PermanentAdd),
new SqlParameter("@_PresentAdd",Emp.PresentAdd),
new SqlParameter("@_Identity",Emp.Identity)};
return Convert.ToBoolean(connectionString,CommandType.Stor edProcedure,"_Insert_Employee",_parameters));
}
pls help me..
thanx in advance..