1

i have to display grid view for the logged in user say for my manager i have written the stored procedure and back end code for it everything looks fine but grid view is not gettin populated please help me

back end code of grid view

                 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");
                  }

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


                 protected void Page_Load(object sender, EventArgs e)
                {
                 MTMSDTO objc = new MTMSDTO();

                  if (!IsPostBack)
                  {
                    GrdManager();
                  }
                }

                   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();
                       }
                     }

here is my 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;
7
  • How does this even get build for you? You have two function with same parameter. Commented Jun 26, 2013 at 13:33
  • can u please refer in which part Commented Jun 26, 2013 at 13:34
  • You have two GetManager function accepting same parameter. unless they are in different class, this shouldn't build at all. Commented Jun 26, 2013 at 13:36
  • 1
    its not 2 functions its only one if im nt wrong... im calling it using access.. im using 3 layered architecture .. Commented Jun 26, 2013 at 13:42
  • can anybody help me with ths please Commented Jun 27, 2013 at 5:37

1 Answer 1

0

You just created a new grid where are you binding it to display on HTML ? You can refer this link to create grid view dynamically.

Sign up to request clarification or add additional context in comments.

5 Comments

can u plz guide me wat shuld i do nw
In your ASPX page put this code inside the form <asp:PlaceHolder id="ph" runat="server" /> and After GridViewTTlist.DataBind(); Just add another line GridViewTTlist.Controls.Add(gv);
An unhandled exception of type 'System.StackOverflowException' occurred in System.dll
Debug the code and try to fix it.. because its not related to this particular question of displaying grid
thnks guys i got d grid view displayed atlast... nt sure wat d prblm was .. but i removed my panel n tried displayng it and i got d result... n i checked the panel properties its nt hidden too...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.