Stored procedure executing but not able to populate gridview

Posted by Su88rao under C# on 6/28/2013 | Points: 10 | Views : 1083 | Status : [Member] | Replies : 2
I need to populate a gridview upon user login. I have written a stored procedure for populating that gridview using login credentials... my stored procedure is working ... I'm able to get the output in SQL Server but once I use login id and password and logs in gridview isn't getting populated... please help me out..

This is my codes and stored procedure

Stored procedure:

ALTER PROCEDURE [dbo].[GetManager]

@EmpName nvarchar(50)

AS

Select TaskName, DueDate, Description, AssignBy, AssignTo, Status, PercentageComplete

From dbo.Task, dbo.EmployeeData

Where AssignTo in (Select EmpName From EmployeeData Where Manager = 'RaghavendraS')

And AssignBy in (Select EmpName From EmployeeData Where Manager = 'RaghavendraS')

And EmpName = @EmpName;

I'm using 3 layered architecture.. wich has DTO,DAL and business layer.. I'm calling data source through these layers.

Backend code

DAL :

public DataSet GetManager(MTMSDTO M)
{
DBAccess db = new DBAccess();
SqlParameter objParam = new SqlParameter("@EmpName", M.EmpName);
objParam.Direction = ParameterDirection.Input;
objParam.Size = 50;

db.Parameters.Add(objParam);
return db.ExecuteDataSet("GetManager");
}

BusinessLayer :

public DataSet GetManager(MTMSDTO M)
{
MTMSAccess obj = new MTMSAccess();
return obj.GetManager(M);
}

Gridview calling function using stored procedure:



protected void GrdManager()
{
MTMSDTO objc = new MTMSDTO();
{
objc.EmpName = Convert.ToString(Session["EmpName"]);
DataSet GrdMA = obj.GetManager(objc);
DataView GrdMan = new DataView();
GrdMan.Table = GrdMA.Tables[0];
GridViewTTlist.DataSource = GrdMan;
GridViewTTlist.DataBind();
}
}




Responses

Posted by: Learningtorise on: 6/28/2013 [Member] Starter | Points: 25

Up
0
Down
Try debugging using F11... Also add Quick Watch on
DataSet GrdMA = obj.GetManager(objc);

and check whether GrdMA is empty.

http://hashtagakash.wordpress.com/

Su88rao, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Learningtorise on: 6/28/2013 [Member] Starter | Points: 25

Up
0
Down
And also verify whether u are updating or doing anything to GridView at Page_Load event

http://hashtagakash.wordpress.com/

Su88rao, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response