gridview不在网页中显示

时间:2013-06-26 13:24:33

标签: c# asp.net sql-server-2008 stored-procedures

我必须为登录用户显示网格视图对我的经理说我已经编写了存储过程和后端代码,一切看起来很好但网格视图不是gettin填充请帮帮我

网格视图的后端代码

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

这是我的存储过程

               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;

1 个答案:

答案 0 :(得分:0)

您刚刚创建了一个新网格,您将它绑定到HTML上显示?您可以参考this link动态创建网格视图。