Usha Raj

Usha Raj

  • NA
  • 144
  • 59.4k

Display data with in grid

Mar 10 2015 12:27 AM
When I click on job tittle it should be redirect to next page with job description,I don't know what is going wrong but after selecting the job tittle am getting the null value,I don't know what is going wrong?so can any one help me my code is like
 
In Stored Procedure:
 
create procedure  USP_Getdetails
@RequirementID int
as
begin
select distinct  PositionTittle,JobDescription from Tbl_RequirementModule where RequirementID=@RequirementID
end
 
In.DAL:
public DataSet GetDdata(int RequirementID)
{
SqlConnection con = dbcon.OpenCoonection();
SqlCommand cmd = new SqlCommand("USP_GetJobDescriptionGrid", con);
cmd.CommandType = CommandType.StoredProcedure;
SqlDataAdapter da = new SqlDataAdapter(cmd);
cmd.Parameters.AddWithValue("@RequirementID", RequirementID);  // If I select position tittle also then am getting null value why??what mistke am                                                                                                                                                                   doing??
DataSet ds = new DataSet();
da.Fill(ds);
dbcon.CloseConnection();
return ds;
}
 
In.cs:
 
public void GetData()
{
int ReqID = Convert.ToInt32(Session["RegId"]);  // Am accessing session variable
JobAlpplingGrid.DataSource = objjob.GetDdata(ReqID);
JobAlpplingGrid.DataBind();
}
 
 

Answers (2)