here is stored procedure code :
ALTER procedure [dbo].[LtoffrEmpPst]
@offPst nvarchar(60),
@sec nvarchar(60) output,
@vil nvarchar(60) output,
@cntr nvarchar(60) output,
@dat datetime output
as
begin
SET NOCOUNT ON;
select @sec=us.Nm_societ,@vil=vil.Nom_ville,@cntr=cn.typContra,@dat=emp.Dat_creat
from OffrEmplwa emp,typ_Uzrs us,sectr_Activit sec,fonkcion fnk ,Vlle vil,Expriens ex
,TypContra cn,Rolle rl where emp.Id_Uzr=us.Id_user and emp.Id_veil=vil.Id_vll
and emp.Id_Contra=cn.IdContra and us.Id_roole=rl.Id_rol
and us.Id_roole=1 and emp.NmPost like '%@offPst%'
group by emp.Id_OffrEmp,us.Nm_societ,emp.NmPost,vil.Nom_ville
,cn.typContra,emp.Dat_creat
end
here is the code of DAL.cs
public DataTable offemplistBypst(DTO dUser)
{
DataTable dt = null;
using (SqlConnection cnx = Conection.GetDbConnection())
{
using (SqlCommand cmd = new SqlCommand("LtoffrEmpPst", cnx))
{
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@offPst", SqlDbType.NVarChar,60).Value = dUser.NmPst;
cnx.Open();
cmd.ExecuteNonQuery();
dt = new DataTable();
SqlDataReader dr = cmd.ExecuteReader();
dt.Load(dr);
dr.Close();
dr.Dispose();
return dt;
}
}
}
plz, can anybody tell me how to make this work