<asp:GridView ID="grdEvaluation_Questions" runat="server" Style="width: 900px; height: auto; margin-left: 200px; margin-top: 50px; border: 3px solid #ccc;" OnRowCommand="grdEvaluation_Questions_OnRowCommand" AutoGenerateColumns="false" OnRowDeleting="grdEvaluation_Questions_RowDeleting" OnRowUpdating="grdEvaluation_Questions_RowUpdating"> <Columns> <asp:BoundField DataField="CategoryName" HeaderText="Category Name" /> <asp:BoundField DataField="SubCategoryName" HeaderText="SubCategory Name" /> <asp:BoundField DataField="QuestionTypeDesc" HeaderText="Question Type" /> <asp:BoundField DataField="QuestionDescription" HeaderText="Question Description" /> <asp:BoundField DataField="PossibleAnswers" HeaderText="Possible Answers" /> <asp:TemplateField> <ItemTemplate> <asp:Button ID="btnEdit" CommandArgument='<%# Eval("QuestionID")%>' CommandName="Update" runat="server" Text="Edit" /> </ItemTemplate> </asp:TemplateField> <asp:TemplateField> <ItemTemplate> <asp:Button ID="btnDelete" CommandArgument='<%# Eval("QuestionID")%>' CommandName="Delete" runat="server" Text="Delete" /> </ItemTemplate> </asp:TemplateField> </Columns> </asp:GridView>
public void GetAllEvaluation_Question() { var EvaluationQuestion = clsEvaluationQuestion.GetAllEvaluation_Question().AsQueryable(); grdEvaluation_Questions.DataSource = EvaluationQuestion; grdEvaluation_Questions.DataBind(); }
public IQueryable GetAllEvaluation_Question() { CastroDataContext objDAL = new CastroDataContext(); var varEvaluation_Question = objDAL.sp_GetAll_Evaluation_Questions().AsQueryable(); return varEvaluation_Question; }
alter PROCEDURE sp_GetAll_Evaluation_Questions AS BEGIN select eq.*,c.CategoryName, sc.SubCategoryName, qt.QuestionTypeDesc from Evaluation_Questions eq inner join QuestionTypes qt on eq.QuestionTypeID=qt.QuestionTypeID inner join Categories c on eq.CategoryID =c.CategoryID left outer join SubCategories sc on eq.SubCategoryID=sc.SubCategoryID where eq.IsDeleted = 0 END GO
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)