Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET
here is my aspx code:
 
<asp:GridView ID="GridViewStudentsList" runat="server" AutoGenerateColumns="False"
               BackColor="White" BorderColor="White" BorderStyle="Ridge" BorderWidth="2px" CellPadding="3"
               CellSpacing="1" EmptyDataText="No Details Found" GridLines="None" OnPageIndexChanging="GridViewStudentsList_PageIndexChanging"
               PagerStyle-Font-Bold="true" PagerStyle-ForeColor="#000066" PageSize="5" Style="z-index: 101;
               left: 60px; position: absolute; top: 80px">
               <RowStyle BackColor="#DEDFDE" ForeColor="Black" />
               <FooterStyle BackColor="#C6C3C6" ForeColor="Black" />
               <PagerStyle BackColor="#C6C3C6" ForeColor="Black" HorizontalAlign="Right" />
               <SelectedRowStyle BackColor="#9471DE" Font-Bold="True" ForeColor="White" />
               <HeaderStyle BackColor="#000066" Font-Bold="True" ForeColor="#E7E7FF" />
               <Columns>
                   <asp:BoundField DataField="Sno" HeaderText="Sno" />
                   <asp:BoundField DataField="RollNo" HeaderText="RollNo" />
                   <asp:BoundField DataField="Name" HeaderText="Name" />
                   <asp:BoundField DataField ="Department" HeaderText ="Department" />
                   <asp:BoundField DataField ="Year" HeaderText ="Year" />
 
               </Columns>
 

           </asp:GridView>
 

And this is my aspx.cs:
 
protected void GridViewStudentsList_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        try
        {
            GridViewStudentsList.PageIndex = e.NewPageIndex;
            FillStudentList();
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
 

public void FillStudentList()
  {
      try
      {
          SqlAdapter = new SqlDataAdapter("select ''Sno,RollNo,Name,Department,StudentsAccounts.Year from StudentsAccounts inner join(select teacherid,Departmentid,dptName,year from TeachersWorkList inner join Departments on Departments.dptid=TeachersWorkList.departmentid Where Teacherid='" + HiddenFieldID.Value + "')As DptList On StudentsAccounts.Department=DptList.dptName And StudentsAccounts.Year=DptList.year where DptList.Departmentid='" + Session["MyDptID"].ToString() + "' And StudentsAccounts.Year='" + Session["Year"].ToString() + "' ", Connection);
          DataSet MyDataSetDetails = new DataSet();
          SqlAdapter.Fill(MyDataSetDetails, "TeachersWorkList");
          for (int i = 0; i <= MyDataSetDetails.Tables[0].Rows.Count - 1; i++)
          {
              MyDataSetDetails.Tables[0].Rows[i][0] = i + 1;
          }
          GridViewStudentsList.DataSource = MyDataSetDetails;
          GridViewStudentsList.DataBind();
      }
      catch (Exception ex)
      {
          throw ex;
      }
  }
 

Now i want to add a extra field mark..where i add a mark?? also in this grid view how can i provide marks for each student? anyone can help me??
Posted 22-Dec-12 1:05am
Comments
SureshDasari1986 at 24-Dec-12 6:27am
   
where do you get the mark field,
can you place the table details related to the marks field.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 335
1 OriginalGriff 250
2 Kornfeld Eliyahu Peter 130
3 DamithSL 120
4 Peter Leow 95
0 OriginalGriff 7,355
1 DamithSL 5,199
2 Sergey Alexandrovich Kryukov 4,942
3 Maciej Los 4,906
4 Kornfeld Eliyahu Peter 4,514


Advertise | Privacy | Mobile
Web03 | 2.8.141223.1 | Last Updated 22 Dec 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100