nelly89 0 Newbie Poster

Urgent..hai i need everyone help.
i have a prob which is i cannot update the GVPapar row by row..actualy im used join table between table Kuiz,table DaftarPelajar and table pelajar..Could is also add table DaftarSubjek when i want to update??? because in update i want also update the data of Kuiz only.In table Kuiz the primary key is IdDaftarSubjek..Any want plez help me :(
here is a code:

<%@ Page Language="VB" Debug="true" MasterPageFile="~/pensyarah/pensyarah.master" AutoEventWireup="false" CodeFile="papanpemuka.aspx.vb" Inherits="pensyarah_papanpemuka" title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <table style="width: 100%;">
    <tr>
        <td>
            <marquee direction="centre">Selamat Datang Ke Laman Pensyarah.</marquee></td>
        <td>
            &nbsp;</td>
        <td>
            &nbsp;</td>
        <td>
            &nbsp;</td>
        <td>
            &nbsp;</td>
        <td>
            &nbsp;</td>
        <td>
            &nbsp;</td>
    </tr>
        <tr>
                <td align="center">
                    <table border="1" style="width: 41%; height: 75px;" align="center">
                        <tr>
                            <td colspan="4">
                                <b>Skor Tahap Pencapaian Pelajar</b></td>
                        </tr>
                        <tr>
                            <td style="width: 64px">
                                Skor</td>
                            <td style="width: 60px">
                                Lemah</td>
                            <td style="width: 65px">
                                Sederhana</td>
                            <td style="width: 69px">
                                Baik</td>
                        </tr>
                        <tr>
                            <td style="width: 64px">
                                Tahap</td>
                            <td bgcolor="#FF0000" style="width: 60px">
                                &nbsp;</td>
                            <td bgcolor="#FFFF00" style="width: 65px">
                                &nbsp;</td>
                            <td bgcolor="#5FFB17" style="width: 69px">
                                &nbsp;</td>
                        </tr>
                    </table>
                </td>
                <td align="center">
                    &nbsp;</td>
                <td align="center">
                    &nbsp;</td>
                <td align="center">
                    &nbsp;</td>
                <td align="center">
                    &nbsp;</td>
                <td align="center">
                    &nbsp;</td>
                <td align="center">
                    &nbsp;</td>
            </tr>
    <tr>
                <td align="center" bgcolor="White" 
                    style="font-size: medium; font-weight: bold; height: 87px;">
                    &nbsp;<img src="bukuPic/project3.jpg" width="120" /> 
                    <img src="bukuPic/lab1.jpg" width="120"  />
                    <img src="bukuPic/test1.jpg" width="90" /> 
                    <img src="bukuPic/quiz1.jpg" width="120" /> 
                    <img src="bukuPic/final1.jpg" width="80" /></td>
                <td align="center" style="height: 87px">
                    </td>
                <td align="center" style="height: 87px">
                    </td>
                <td align="center" style="height: 87px">
                    </td>
                <td align="center" style="height: 87px">
                    </td>
                <td align="center" style="height: 87px">
                    </td>
                <td align="center" style="height: 87px">
                    </td>
    </tr>
    <tr>
                <td align="center">
                    <asp:Label ID="lblKodSubjek" runat="server" Text="Kod Subjek : "></asp:Label>
                    <asp:DropDownList ID="DropDownList1" runat="server" 
                        DataSourceID="SqlDataSource10" DataTextField="KodSubjek" 
                        DataValueField="KodSubjek" >
                    </asp:DropDownList>
                    <asp:SqlDataSource ID="SqlDataSource10" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                        
                        
                        
                        SelectCommand="SELECT DISTINCT subjek.KodSubjek  FROM DaftarSubjek INNER JOIN subjek ON DaftarSubjek.KodSubjek = subjek.KodSubjek INNER JOIN Daftar ON DaftarSubjek.IdLec = Daftar.IdLec WHERE (Daftar.NoMatrik = @NoMatrik)" 
                        >
                        
                        <SelectParameters>
                            <asp:SessionParameter Name="NoMatrik" SessionField="ID" />
                        </SelectParameters>
                    </asp:SqlDataSource>
                </td>
                <td align="center">
                    &nbsp;</td>
                <td align="center">
                    &nbsp;</td>
                <td align="center">
                    &nbsp;</td>
                <td align="center">
                    &nbsp;</td>
                <td align="center">
                    &nbsp;</td>
                <td align="center">
                    &nbsp;</td>
    </tr>
    <tr>
                <td align="center">
                    <asp:Label ID="lblSeksyen" runat="server" Text="Seksyen :      "></asp:Label>
                    <asp:DropDownList ID="DropDownList2" runat="server">
                        <asp:ListItem>Sila Pilih</asp:ListItem>
                        <asp:ListItem>1</asp:ListItem>
                        <asp:ListItem>2</asp:ListItem>
                        <asp:ListItem>3</asp:ListItem>
                        <asp:ListItem>4</asp:ListItem>
                        <asp:ListItem>5</asp:ListItem>
                        <asp:ListItem>6</asp:ListItem>
                        <asp:ListItem>7</asp:ListItem>
                        <asp:ListItem>8</asp:ListItem>
                        <asp:ListItem>9</asp:ListItem>
                        <asp:ListItem>10</asp:ListItem>
                    </asp:DropDownList>
                    &nbsp;</td>
                <td align="center">
                    &nbsp;</td>
                <td align="center">
                    &nbsp;</td>
                <td align="center">
                    &nbsp;</td>
                <td align="center">
                    &nbsp;</td>
                <td align="center">
                    &nbsp;</td>
                <td align="center">
                    &nbsp;</td>
    </tr>
    <tr>
        <td align="center">
                    <asp:Button ID="btnCarian" runat="server" Text="Carian" />
        </td>
        <td align="center">
                    &nbsp;</td>
        <td align="center">
                    &nbsp;</td>
        <td align="center">
                    &nbsp;</td>
        <td align="center">
                    &nbsp;</td>
        <td align="center">
                    &nbsp;</td>
        <td align="center">
                    &nbsp;</td>
    </tr>
    <tr>
        <td align="center">
                    <asp:Label ID="lblSila" runat="server" BackColor="#CCCCCC" 
                        Text="Sila Pilih Kerja Kursus Di Bawah :" Visible="False"></asp:Label>
        </td>
        <td align="center">
                    &nbsp;</td>
        <td align="center">
                    &nbsp;</td>
        <td align="center">
                    &nbsp;</td>
        <td align="center">
                    &nbsp;</td>
        <td align="center">
                    &nbsp;</td>
        <td align="center">
                    &nbsp;</td>
    </tr>
    <tr>
        <td align="center">
                    <asp:DropDownList ID="ddlKerjaKursus" runat="server" Visible="False">
                        <asp:ListItem>Sila Pilih</asp:ListItem>
                        <asp:ListItem>Kuiz</asp:ListItem>
                        <asp:ListItem>Tugasan</asp:ListItem>
                        <asp:ListItem>Makmal</asp:ListItem>
                        <asp:ListItem>Projek</asp:ListItem>
                        <asp:ListItem>Ujian</asp:ListItem>
                        <asp:ListItem>Peperiksaan Akhir</asp:ListItem>
                    </asp:DropDownList>
        </td>
        <td align="center">
                    &nbsp;</td>
        <td align="center">
                    &nbsp;</td>
        <td align="center">
                    &nbsp;</td>
        <td align="center">
                    &nbsp;</td>
        <td align="center">
                    &nbsp;</td>
        <td align="center">
                    &nbsp;</td>
    </tr>
    <tr>
        <td>
    <p align="center">
        &nbsp;&nbsp;<asp:Button ID="btnSubmit" runat="server" Text="Hantar" Visible="False" />
        &nbsp;<table style="width:100%;">
            <tr>
                <td>
                    <asp:Label ID="lblKeputusan" runat="server" Text="Maklumat Subjek : " 
                        Visible="False"></asp:Label>
                </td>
            </tr>
            <tr>
                <td>
                        <asp:Button ID="btnSms" runat="server" Text="Notifikasi Kuiz" Visible="False" />
                </td>
            </tr>
            <tr>
                <td>
                            <asp:GridView ID="GVPapar" runat="server" AutoGenerateColumns="False" 
                                AutoGenerateEditButton="True" DataSourceID="SqlDataSource1" Visible="False" OnRowDataBound="GVPapar_RowDataBound">
                                <PagerSettings Position="Top" />
                                <Columns>
                                    <asp:BoundField DataField="Nama" HeaderText="Nama" SortExpression="Nama" />
                                    <asp:BoundField DataField="NoKP" HeaderText="NoKP" SortExpression="NoKP" />
                                    <asp:BoundField DataField="NoMatrik" HeaderText="NoMatrik" 
                                        SortExpression="NoMatrik" />
                                    <asp:BoundField DataField="Kuiz1" HeaderText="Kuiz1" SortExpression="Kuiz1" />
                                    <asp:BoundField DataField="Kuiz2" HeaderText="Kuiz2" SortExpression="Kuiz2" />
                                    <asp:BoundField DataField="Kuiz3" HeaderText="Kuiz3" SortExpression="Kuiz3" />
                                    <asp:BoundField DataField="Kuiz4" HeaderText="Kuiz4" SortExpression="Kuiz4" />
                                    <asp:BoundField DataField="Kuiz5" HeaderText="Kuiz5" SortExpression="Kuiz5" />
                                    <asp:BoundField DataField="Jumlah" HeaderText="Jumlah" 
                                        SortExpression="Jumlah" />
                                    <asp:BoundField DataField="Purata" HeaderText="Purata" 
                                        SortExpression="Purata" />
                                </Columns>
                                <PagerStyle Wrap="False" />
                            </asp:GridView>
                            <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                                ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                                DeleteCommand="DELETE FROM Kuiz WHERE Kuiz.IdDaftarSubjek=@IdDaftarSubjek" 
                                InsertCommand="INSERT INTO Kuiz(Kuiz1, Kuiz2, Kuiz3, Kuiz4, Kuiz5, Jumlah, Purata) VALUES (@Kuiz1, @Kuiz2, @Kuiz3, @Kuiz4, @Kuiz5, @Jumlah, @Purata)" 
                                SelectCommand="SELECT pelajar.Nama, pelajar.NoKP, pelajar.NoMatrik, Kuiz.Kuiz1, Kuiz.Kuiz2, Kuiz.Kuiz3, Kuiz.Kuiz4, Kuiz.Kuiz5, Kuiz.Jumlah, Kuiz.Purata FROM DaftarSubjek INNER JOIN Kuiz ON DaftarSubjek.IdDaftarSubjek = Kuiz.IdDaftarSubjek INNER JOIN pelajar ON DaftarSubjek.IdStud = pelajar.IdStud WHERE (DaftarSubjek.KodSubjek = @KodSubjek) AND (DaftarSubjek.Seksyen = @Seksyen)" 
                                
                                
                                
                                
                                UpdateCommand="UPDATE Kuiz SET Kuiz1 = @Kuiz1, Kuiz2 = @Kuiz2, Kuiz3 = @Kuiz3, Kuiz4 = @Kuiz4, Kuiz5 = @Kuiz5, Jumlah = @Jumlah, Purata = @Purata FROM Kuiz INNER JOIN pelajar ON Kuiz.IdStud = pelajar.IdStud WHERE (Kuiz.IdDaftarSubjek = @IdDaftarSubjek)">
                                <SelectParameters>
                                    <asp:ControlParameter ControlID="DropDownList1" Name="KodSubjek" 
                                        PropertyName="SelectedValue" />
                                    <asp:ControlParameter ControlID="DropDownList2" Name="Seksyen" 
                                        PropertyName="SelectedValue" />
                                </SelectParameters>
                                <DeleteParameters>
                                    <asp:Parameter Name="IdDaftarSubjek" />
                                </DeleteParameters>
                                <UpdateParameters>
                                    <asp:Parameter Name="Kuiz1" />
                                    <asp:Parameter Name="Kuiz2" />
                                    <asp:Parameter Name="Kuiz3" />
                                    <asp:Parameter Name="Kuiz4" />
                                    <asp:Parameter Name="Kuiz5" />
                                    <asp:Parameter Name="Jumlah" />
                                    <asp:Parameter Name="Purata" />
                                    <asp:Parameter Name="IdDaftarSubjek" />
                                </UpdateParameters>
                                <InsertParameters>
                                    <asp:Parameter Name="Kuiz1" />
                                    <asp:Parameter Name="Kuiz2" />
                                    <asp:Parameter Name="Kuiz3" />
                                    <asp:Parameter Name="Kuiz4" />
                                    <asp:Parameter Name="Kuiz5" />
                                    <asp:Parameter Name="Jumlah" />
                                    <asp:Parameter Name="Purata" />
                                </InsertParameters>
                            </asp:SqlDataSource>
                </td>
            </tr>
            <tr>
                <td>
                        <asp:Button ID="btnSmsTugasan" runat="server" Text="Notifikasi Tugasan" 
                            Visible="False" />
                        &nbsp;<asp:GridView ID="GVPaparTugasan" runat="server" 
    AutoGenerateColumns="False" DataSourceID="SqlDataSource2" Visible="False" 
                                OnRowDataBound ="GVPaparTugasan_RowDataBound" HorizontalAlign="Center">
                                <Columns>
                                    <asp:CommandField ShowDeleteButton="True" 
            ShowEditButton="True" />
                                    <asp:BoundField DataField="Nama" HeaderText="Nama" 
            SortExpression="Nama" />
                                    <asp:BoundField DataField="NoKP" HeaderText="NoKP" 
            SortExpression="NoKP" />
                                    <asp:BoundField DataField="NoMatrik" 
            HeaderText="NoMatrik" SortExpression="NoMatrik" />
                                    <asp:BoundField DataField="Tugasan1" 
            HeaderText="Tugasan1" SortExpression="Tugasan1" />
                                    <asp:BoundField DataField="Tugasan2" 
            HeaderText="Tugasan2" SortExpression="Tugasan2" />
                                    <asp:BoundField DataField="Tugasan3" 
            HeaderText="Tugasan3" SortExpression="Tugasan3" />
                                    <asp:TemplateField HeaderText="Jumlah" SortExpression="Jumlah">
                                        <EditItemTemplate>
                                            <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Jumlah") %>'></asp:TextBox>
                                        </EditItemTemplate>
                                        <ItemTemplate>
                                            <asp:Literal ID="litJumlah1" runat="server"></asp:Literal>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Purata" SortExpression="Purata">
                                        <EditItemTemplate>
                                            <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("Purata") %>'></asp:TextBox>
                                        </EditItemTemplate>
                                        <ItemTemplate>
                                            <asp:Literal ID="litPurata1" runat="server"></asp:Literal>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                            </asp:GridView>
                        </td>
            </tr>
            <tr>
                <td>
                    <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                        DeleteCommand="DELETE FROM [Tugasan] WHERE [IdDaftarSubjek] = @IdDaftarSubjek" 
                        InsertCommand="INSERT INTO [Tugasan] ([IdStud], [IdDaftarSubjek], [Tugasan1], [Tugasan2], [Tugasan3], [Jumlah], [Purata]) VALUES (@IdStud, @IdDaftarSubjek, @Tugasan1, @Tugasan2, @Tugasan3, @Jumlah, @Purata)" 
                        SelectCommand="SELECT pelajar.Nama, pelajar.NoKP, pelajar.NoMatrik, Tugasan.Tugasan1, Tugasan.Tugasan2, Tugasan.Tugasan3, Tugasan.Jumlah, Tugasan.Purata FROM DaftarSubjek INNER JOIN pelajar ON DaftarSubjek.IdStud = pelajar.IdStud INNER JOIN Tugasan ON DaftarSubjek.IdDaftarSubjek = Tugasan.IdDaftarSubjek WHERE (DaftarSubjek.KodSubjek = @KodSubjek) AND (DaftarSubjek.Seksyen = @Seksyen)" 
                        UpdateCommand="UPDATE Tugasan SET IdStud = @IdStud, Tugasan1 = @Tugasan1, Tugasan2 = @Tugasan2, Tugasan3 = @Tugasan3, Jumlah = @Jumlah, Purata = @Purata FROM Tugasan INNER JOIN pelajar ON Tugasan.IdStud = pelajar.IdStud WHERE (Tugasan.IdDaftarSubjek = @IdDaftarSubjek)">
                        <SelectParameters>
                            <asp:ControlParameter ControlID="DropDownList1" Name="KodSubjek" 
                                PropertyName="SelectedValue" />
                            <asp:ControlParameter ControlID="DropDownList2" Name="Seksyen" 
                                PropertyName="SelectedValue" />
                        </SelectParameters>
                        <DeleteParameters>
                            <asp:Parameter Name="IdDaftarSubjek" Type="Int32" />
                        </DeleteParameters>
                        <UpdateParameters>
                            <asp:Parameter Name="IdStud" Type="Int32" />
                            <asp:Parameter Name="Tugasan1" Type="String" />
                            <asp:Parameter Name="Tugasan2" Type="String" />
                            <asp:Parameter Name="Tugasan3" Type="String" />
                            <asp:Parameter Name="Jumlah" Type="String" />
                            <asp:Parameter Name="Purata" Type="String" />
                            <asp:Parameter Name="IdDaftarSubjek" Type="Int32" />
                        </UpdateParameters>
                        <InsertParameters>
                            <asp:Parameter Name="IdStud" Type="Int32" />
                            <asp:Parameter Name="IdDaftarSubjek" Type="Int32" />
                            <asp:Parameter Name="Tugasan1" Type="String" />
                            <asp:Parameter Name="Tugasan2" Type="String" />
                            <asp:Parameter Name="Tugasan3" Type="String" />
                            <asp:Parameter Name="Jumlah" Type="String" />
                            <asp:Parameter Name="Purata" Type="String" />
                        </InsertParameters>
                    </asp:SqlDataSource>
                    <asp:SqlDataSource ID="SqlDataSource17" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                        SelectCommand="SELECT [IdStud], [Jumlah], [Purata] FROM [Tugasan]" 
                        UpdateCommand="UPDATE Tugasan SET Jumlah = @Jumlah, Purata = @Purata WHERE (IdStud = @IdStud)">
                        <UpdateParameters>
                            <asp:Parameter Name="Jumlah" />
                            <asp:Parameter Name="Purata" />
                            <asp:Parameter Name="IdStud" />
                        </UpdateParameters>
                    </asp:SqlDataSource>
                        <asp:Button ID="btnSmsMakmal" runat="server" Text="Notifikasi Makmal" 
                        Visible="False" />
    <asp:GridView ID="GVPaparMakmal" runat="server" AutoGenerateColumns="False" 
                        DataSourceID="SqlDataSource3" Visible="False" 
    OnRowDataBound  = "GVPaparMakmal_RowDataBound">
        <Columns>
            <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
            <asp:BoundField DataField="Nama" HeaderText="Nama" SortExpression="Nama" />
            <asp:BoundField DataField="NoKP" HeaderText="NoKP" SortExpression="NoKP" />
            <asp:BoundField DataField="NoMatrik" HeaderText="NoMatrik" 
                                SortExpression="NoMatrik" />
            <asp:BoundField DataField="Makmal1" HeaderText="Makmal1" 
                                SortExpression="Makmal1" />
            <asp:BoundField DataField="Makmal2" HeaderText="Makmal2" 
                                SortExpression="Makmal2" />
            <asp:BoundField DataField="Makmal3" HeaderText="Makmal3" 
                                SortExpression="Makmal3" />
            <asp:BoundField DataField="Makmal4" HeaderText="Makmal4" 
                                SortExpression="Makmal4" />
            <asp:TemplateField HeaderText="Jumlah" SortExpression="Jumlah">
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Jumlah") %>'></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Literal ID="Literal1" runat="server"></asp:Literal>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Purata" SortExpression="Purata">
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("Purata") %>'></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Literal ID="Literal2" runat="server"></asp:Literal>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
                    <asp:SqlDataSource ID="SqlDataSource3" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                        DeleteCommand="DELETE FROM [Makmal] WHERE [IdDaftarSubjek] = @IdDaftarSubjek" 
                        InsertCommand="INSERT INTO [Makmal] ([IdStud], [IdDaftarSubjek], [Makmal1], [Makmal2], [Makmal3], [Makmal4], [Jumlah], [Purata]) VALUES (@IdStud, @IdDaftarSubjek, @Makmal1, @Makmal2, @Makmal3, @Makmal4, @Jumlah, @Purata)" 
                        SelectCommand="SELECT pelajar.Nama, pelajar.NoKP, pelajar.NoMatrik, Makmal.Makmal1, Makmal.Makmal2, Makmal.Makmal3, Makmal.Makmal4, Makmal.Jumlah, Makmal.Purata FROM DaftarSubjek INNER JOIN Makmal ON DaftarSubjek.IdDaftarSubjek = Makmal.IdDaftarSubjek INNER JOIN pelajar ON DaftarSubjek.IdStud = pelajar.IdStud WHERE (DaftarSubjek.KodSubjek = @KodSubjek) AND (DaftarSubjek.Seksyen = @Seksyen)" 
                        UpdateCommand="UPDATE Makmal SET IdStud = @IdStud, Makmal1 = @Makmal1, Makmal2 = @Makmal2, Makmal3 = @Makmal3, Makmal4 = @Makmal4, Jumlah = @Jumlah, Purata = @Purata FROM Makmal INNER JOIN pelajar ON Makmal.IdStud = pelajar.IdStud WHERE (Makmal.IdDaftarSubjek = @IdDaftarSubjek)">
                        <SelectParameters>
                            <asp:ControlParameter ControlID="DropDownList1" Name="KodSubjek" 
                                PropertyName="SelectedValue" />
                            <asp:ControlParameter ControlID="DropDownList2" Name="Seksyen" 
                                PropertyName="SelectedValue" />
                        </SelectParameters>
                        <DeleteParameters>
                            <asp:Parameter Name="IdDaftarSubjek" Type="Int32" />
                        </DeleteParameters>
                        <UpdateParameters>
                            <asp:Parameter Name="IdStud" Type="Int32" />
                            <asp:Parameter Name="Makmal1" Type="String" />
                            <asp:Parameter Name="Makmal2" Type="String" />
                            <asp:Parameter Name="Makmal3" Type="String" />
                            <asp:Parameter Name="Makmal4" Type="String" />
                            <asp:Parameter Name="Jumlah" Type="String" />
                            <asp:Parameter Name="Purata" Type="String" />
                            <asp:Parameter Name="IdDaftarSubjek" Type="Int32" />
                        </UpdateParameters>
                        <InsertParameters>
                            <asp:Parameter Name="IdStud" Type="Int32" />
                            <asp:Parameter Name="IdDaftarSubjek" Type="Int32" />
                            <asp:Parameter Name="Makmal1" Type="String" />
                            <asp:Parameter Name="Makmal2" Type="String" />
                            <asp:Parameter Name="Makmal3" Type="String" />
                            <asp:Parameter Name="Makmal4" Type="String" />
                            <asp:Parameter Name="Jumlah" Type="String" />
                            <asp:Parameter Name="Purata" Type="String" />
                        </InsertParameters>
                    </asp:SqlDataSource>
                    <asp:SqlDataSource ID="SqlDataSource18" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                        SelectCommand="SELECT [IdStud], [Jumlah], [Purata] FROM [Makmal]" 
                        UpdateCommand="UPDATE Makmal SET Jumlah = @Jumlah, Purata = @Purata WHERE (IdStud = @IdStud)">
                        <UpdateParameters>
                            <asp:Parameter Name="Jumlah" />
                            <asp:Parameter Name="Purata" />
                            <asp:Parameter Name="IdStud" />
                        </UpdateParameters>
                    </asp:SqlDataSource>
                        <asp:Button ID="btnSmsProjek" runat="server" Text="Notifikasi Projek" 
                        Visible="False" />
                            <asp:GridView ID="GVPaparProjek" runat="server" 
    AutoGenerateColumns="False" DataSourceID="SqlDataSource4" Visible="False" 
                                OnRowDataBound ="GVPaparProjek_RowDataBound">
                                <Columns>
                                    <asp:CommandField ShowDeleteButton="True" 
            ShowEditButton="True" />
                                    <asp:BoundField DataField="Nama" HeaderText="Nama" 
            SortExpression="Nama" />
                                    <asp:BoundField DataField="NoKP" HeaderText="NoKP" 
            SortExpression="NoKP" />
                                    <asp:BoundField DataField="NoMatrik" 
            HeaderText="NoMatrik" SortExpression="NoMatrik" />
                                    <asp:BoundField DataField="Projek1" HeaderText="Projek1" 
            SortExpression="Projek1" />
                                    <asp:BoundField DataField="Projek2" HeaderText="Projek2" 
            SortExpression="Projek2" />
                                    <asp:TemplateField HeaderText="Jumlah" 
            SortExpression="Jumlah">
                                        <EditItemTemplate>
                                            <asp:TextBox ID="TextBox1" runat="server" 
                    Text='<%# Bind("Jumlah") %>'></asp:TextBox>
                                        </EditItemTemplate>
                                        <ItemTemplate>
                                            <asp:Literal ID="Literal3" runat="server"></asp:Literal>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Purata" 
            SortExpression="Purata">
                                        <EditItemTemplate>
                                            <asp:TextBox ID="TextBox2" runat="server" 
                    Text='<%# Bind("Purata") %>'></asp:TextBox>
                                        </EditItemTemplate>
                                        <ItemTemplate>
                                            <asp:Literal ID="Literal4" runat="server"></asp:Literal>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                            </asp:GridView>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:SqlDataSource ID="SqlDataSource4" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                        DeleteCommand="DELETE FROM [Projek] WHERE [IdDaftarSubjek] = @IdDaftarSubjek" 
                        InsertCommand="INSERT INTO [Projek] ([IdStud], [IdDaftarSubjek], [Projek1], [Projek2], [Jumlah], [Purata]) VALUES (@IdStud, @IdDaftarSubjek, @Projek1, @Projek2, @Jumlah, @Purata)" 
                        SelectCommand="SELECT pelajar.Nama, pelajar.NoKP, pelajar.NoMatrik, Projek.Projek1, Projek.Projek2, Projek.Jumlah, Projek.Purata FROM DaftarSubjek INNER JOIN pelajar ON DaftarSubjek.IdStud = pelajar.IdStud INNER JOIN Projek ON DaftarSubjek.IdDaftarSubjek = Projek.IdDaftarSubjek WHERE (DaftarSubjek.KodSubjek = @KodSubjek) AND (DaftarSubjek.Seksyen = @Seksyen)" 
                        UpdateCommand="UPDATE Projek SET IdStud = @IdStud, Projek1 = @Projek1, Projek2 = @Projek2, Jumlah = @Jumlah, Purata = @Purata FROM Projek INNER JOIN pelajar ON Projek.IdStud = pelajar.IdStud WHERE (Projek.IdDaftarSubjek = @IdDaftarSubjek)">
                        <SelectParameters>
                            <asp:ControlParameter ControlID="DropDownList1" Name="KodSubjek" 
                                PropertyName="SelectedValue" />
                            <asp:ControlParameter ControlID="DropDownList2" Name="Seksyen" 
                                PropertyName="SelectedValue" />
                        </SelectParameters>
                        <DeleteParameters>
                            <asp:Parameter Name="IdDaftarSubjek" Type="Int32" />
                        </DeleteParameters>
                        <UpdateParameters>
                            <asp:Parameter Name="IdStud" Type="Int32" />
                            <asp:Parameter Name="Projek1" Type="String" />
                            <asp:Parameter Name="Projek2" Type="String" />
                            <asp:Parameter Name="Jumlah" Type="String" />
                            <asp:Parameter Name="Purata" Type="String" />
                            <asp:Parameter Name="IdDaftarSubjek" Type="Int32" />
                        </UpdateParameters>
                        <InsertParameters>
                            <asp:Parameter Name="IdStud" Type="Int32" />
                            <asp:Parameter Name="IdDaftarSubjek" Type="Int32" />
                            <asp:Parameter Name="Projek1" Type="String" />
                            <asp:Parameter Name="Projek2" Type="String" />
                            <asp:Parameter Name="Jumlah" Type="String" />
                            <asp:Parameter Name="Purata" Type="String" />
                        </InsertParameters>
                    </asp:SqlDataSource>
                    <asp:SqlDataSource ID="SqlDataSource19" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                        SelectCommand="SELECT [IdStud], [Jumlah], [Purata] FROM [Projek]" 
                        UpdateCommand="UPDATE Projek SET Jumlah = @Jumlah, Purata = @Purata WHERE (IdStud = @IdStud)">
                        <UpdateParameters>
                            <asp:Parameter Name="Jumlah" />
                            <asp:Parameter Name="Purata" />
                            <asp:Parameter Name="IdStud" />
                        </UpdateParameters>
                    </asp:SqlDataSource>
                </td>
            </tr>
            <tr>
                <td>
                        <asp:Button ID="btnSmsUjian" runat="server" Text="Notifikasi Ujian" 
                        Visible="False" />
                        <asp:GridView ID="GVPaparUjian" runat="server" AutoGenerateColumns="False" 
                            DataSourceID="SqlDataSource5" Visible="False" 
    OnRowDataBound ="GVPaparUjian_RowDataBound">
                            <Columns>
                                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
                                <asp:BoundField DataField="Nama" HeaderText="Nama" SortExpression="Nama" />
                                <asp:BoundField DataField="NoKP" HeaderText="NoKP" SortExpression="NoKP" />
                                <asp:BoundField DataField="NoMatrik" HeaderText="NoMatrik" 
                                    SortExpression="NoMatrik" />
                                <asp:BoundField DataField="Ujian1" HeaderText="Ujian1" 
                                    SortExpression="Ujian1" />
                                <asp:BoundField DataField="Ujian2" HeaderText="Ujian2" 
                                    SortExpression="Ujian2" />
                                <asp:TemplateField HeaderText="Jumlah" SortExpression="Jumlah">
                                    <EditItemTemplate>
                                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Jumlah") %>'></asp:TextBox>
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Literal ID="Literal5" runat="server"></asp:Literal>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Purata" SortExpression="Purata">
                                    <EditItemTemplate>
                                        <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("Purata") %>'></asp:TextBox>
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Literal ID="Literal6" runat="server"></asp:Literal>
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                        </asp:GridView>
                    </td>
            </tr>
            <tr>
                <td>
                        <asp:SqlDataSource ID="SqlDataSource5" runat="server" 
                            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                            DeleteCommand="DELETE FROM [Ujian] WHERE [IdDaftarSubjek] = @IdDaftarSubjek" 
                            InsertCommand="INSERT INTO [Ujian] ([IdStud], [IdDaftarSubjek], [Ujian1], [Ujian2], [Jumlah], [Purata]) VALUES (@IdStud, @IdDaftarSubjek, @Ujian1, @Ujian2, @Jumlah, @Purata)" 
                            SelectCommand="SELECT pelajar.Nama, pelajar.NoKP, pelajar.NoMatrik, Ujian.Ujian1, Ujian.Ujian2, Ujian.Jumlah, Ujian.Purata FROM Ujian INNER JOIN pelajar ON Ujian.IdStud = pelajar.IdStud INNER JOIN DaftarSubjek ON Ujian.IdDaftarSubjek = DaftarSubjek.IdDaftarSubjek WHERE (DaftarSubjek.KodSubjek = @KodSubjek) AND (DaftarSubjek.Seksyen = @Seksyen)" 
                            UpdateCommand="UPDATE Ujian SET IdStud = @IdStud, Ujian1 = @Ujian1, Ujian2 = @Ujian2, Jumlah = @Jumlah, Purata = @Purata FROM Ujian INNER JOIN pelajar ON Ujian.IdStud = pelajar.IdStud WHERE (Ujian.IdDaftarSubjek = @IdDaftarSubjek)">
                            <SelectParameters>
                                <asp:ControlParameter ControlID="DropDownList1" Name="KodSubjek" 
                                    PropertyName="SelectedValue" />
                                <asp:ControlParameter ControlID="DropDownList2" Name="Seksyen" 
                                    PropertyName="SelectedValue" />
                            </SelectParameters>
                            <DeleteParameters>
                                <asp:Parameter Name="IdDaftarSubjek" Type="Int32" />
                            </DeleteParameters>
                            <UpdateParameters>
                                <asp:Parameter Name="IdStud" Type="Int32" />
                                <asp:Parameter Name="Ujian1" Type="String" />
                                <asp:Parameter Name="Ujian2" Type="String" />
                                <asp:Parameter Name="Jumlah" Type="String" />
                                <asp:Parameter Name="Purata" Type="String" />
                                <asp:Parameter Name="IdDaftarSubjek" Type="Int32" />
                            </UpdateParameters>
                            <InsertParameters>
                                <asp:Parameter Name="IdStud" Type="Int32" />
                                <asp:Parameter Name="IdDaftarSubjek" Type="Int32" />
                                <asp:Parameter Name="Ujian1" Type="String" />
                                <asp:Parameter Name="Ujian2" Type="String" />
                                <asp:Parameter Name="Jumlah" Type="String" />
                                <asp:Parameter Name="Purata" Type="String" />
                            </InsertParameters>
                        </asp:SqlDataSource>
                        <asp:SqlDataSource ID="SqlDataSource20" runat="server" 
                            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                            SelectCommand="SELECT [IdStud], [Jumlah], [Purata] FROM [Ujian]" 
                            UpdateCommand="UPDATE Ujian SET Jumlah = @Jumlah, Purata = @Purata WHERE (IdStud = @IdStud)">
                            <UpdateParameters>
                                <asp:Parameter Name="Jumlah" />
                                <asp:Parameter Name="Purata" />
                                <asp:Parameter Name="IdStud" />
                            </UpdateParameters>
                        </asp:SqlDataSource>
                    </td>
            </tr>
            <tr>
                <td>
                        <asp:Button ID="btnSmsPAkhir" runat="server" Text="Notifikasi P.Akhir" 
                        Visible="False" />
                        <asp:GridView ID="GVPaparFinal" runat="server" AutoGenerateColumns="False" 
                            DataSourceID="SqlDataSource6" Visible="False" OnRowDataBound ="GVPaparFinal_RowDataBound">
                            <Columns>
                                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
                                <asp:BoundField DataField="Nama" HeaderText="Nama" SortExpression="Nama" />
                                <asp:BoundField DataField="NoKP" HeaderText="NoKP" SortExpression="NoKP" />
                                <asp:BoundField DataField="NoMatrik" HeaderText="NoMatrik" 
                                    SortExpression="NoMatrik" />
                                <asp:TemplateField HeaderText="Jumlah" SortExpression="Jumlah">
                                    <EditItemTemplate>
                                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Jumlah") %>'></asp:TextBox>
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Literal ID="Literal7" runat="server"></asp:Literal>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Purata" SortExpression="Purata">
                                    <EditItemTemplate>
                                        <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("Purata") %>'></asp:TextBox>
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Literal ID="Literal8" runat="server"></asp:Literal>
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                        </asp:GridView>
                    </td>
            </tr>
            <tr>
                <td>
                        <asp:SqlDataSource ID="SqlDataSource6" runat="server" 
                            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                            DeleteCommand="DELETE FROM [Final] WHERE [IdDaftarSubjek] = @IdDaftarSubjek" 
                            InsertCommand="INSERT INTO [Final] ([IdStud], [IdDaftarSubjek], [PeperiksaanAkhir], [Jumlah], [Purata]) VALUES (@IdStud, @IdDaftarSubjek, @PeperiksaanAkhir, @Jumlah, @Purata)" 
                            SelectCommand="SELECT pelajar.Nama, pelajar.NoKP, pelajar.NoMatrik, Final.Jumlah, Final.Purata FROM DaftarSubjek INNER JOIN Final ON DaftarSubjek.IdDaftarSubjek = Final.IdDaftarSubjek INNER JOIN pelajar ON DaftarSubjek.IdStud = pelajar.IdStud WHERE (DaftarSubjek.KodSubjek = @KodSubjek) AND (DaftarSubjek.Seksyen = @Seksyen)" 
                            UpdateCommand="UPDATE Final SET IdStud = @IdStud, PeperiksaanAkhir = @PeperiksaanAkhir, Jumlah = @Jumlah, Purata = @Purata FROM Final INNER JOIN pelajar ON Final.IdStud = pelajar.IdStud WHERE (Final.IdDaftarSubjek = @IdDaftarSubjek)">
                            <SelectParameters>
                                <asp:ControlParameter ControlID="DropDownList1" Name="KodSubjek" 
                                    PropertyName="SelectedValue" />
                                <asp:ControlParameter ControlID="DropDownList2" Name="Seksyen" 
                                    PropertyName="SelectedValue" />
                            </SelectParameters>
                            <DeleteParameters>
                                <asp:Parameter Name="IdDaftarSubjek" Type="Int32" />
                            </DeleteParameters>
                            <UpdateParameters>
                                <asp:Parameter Name="IdStud" Type="Int32" />
                                <asp:Parameter Name="PeperiksaanAkhir" Type="String" />
                                <asp:Parameter Name="Jumlah" Type="String" />
                                <asp:Parameter Name="Purata" Type="String" />
                                <asp:Parameter Name="IdDaftarSubjek" Type="Int32" />
                            </UpdateParameters>
                            <InsertParameters>
                                <asp:Parameter Name="IdStud" Type="Int32" />
                                <asp:Parameter Name="IdDaftarSubjek" Type="Int32" />
                                <asp:Parameter Name="PeperiksaanAkhir" Type="String" />
                                <asp:Parameter Name="Jumlah" Type="String" />
                                <asp:Parameter Name="Purata" Type="String" />
                            </InsertParameters>
                        </asp:SqlDataSource>
                        <asp:SqlDataSource ID="SqlDataSource21" runat="server" 
                            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                            SelectCommand="SELECT [IdStud], [Jumlah], [Purata] FROM [Final]" 
                            UpdateCommand="UPDATE Final SET Jumlah = @Jumlah, Purata = @Purata WHERE (IdStud = @IdStud)">
                            <UpdateParameters>
                                <asp:Parameter Name="Jumlah" />
                                <asp:Parameter Name="Purata" />
                                <asp:Parameter Name="IdStud" />
                            </UpdateParameters>
                        </asp:SqlDataSource>
                </td>
            </tr>
            </table>
    </p>
        </td>
        <td>
            &nbsp;</td>
        <td>
            &nbsp;</td>
        <td>
            &nbsp;</td>
        <td>
            &nbsp;</td>
        <td>
            &nbsp;</td>
        <td>
            &nbsp;</td>
    </tr>
    </table>
</asp:Content>

and here is code back:

Imports System.Data
Imports System.Data.Common
Imports System.Data.SqlClient
Imports System.Data.Common.DbConnection
Imports System.Configuration
Imports System.Web
Imports System.Web.Security
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.WebControls.WebParts
Imports System.Web.UI.HtmlControls

Partial Class pensyarah_papanpemuka
    Inherits System.Web.UI.Page
    Protected Sub GVPaparTugasan_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs)
        If e.Row.RowType = DataControlRowType.DataRow Then
            Dim litPurata1 As Literal = DirectCast(e.Row.FindControl("litPurata1"), Literal)
            Dim litJumlah1 As Literal = DirectCast(e.Row.FindControl("litJumlah1"), Literal)


            Dim Tugasan1 As Double = Convert.ToDouble(DataBinder.Eval(e.Row.DataItem, "Tugasan1"))
            Dim Tugasan2 As Double = Convert.ToDouble(DataBinder.Eval(e.Row.DataItem, "Tugasan2"))
            Dim Tugasan3 As Double = Convert.ToDouble(DataBinder.Eval(e.Row.DataItem, "Tugasan3"))

            Dim Jumlah As Double = 0.0
            If litJumlah1 IsNot Nothing Then
                Jumlah = (Tugasan1 + Tugasan2 + Tugasan3)
                litJumlah1.Text = Jumlah
                Dim Purata As Double = 0.0
                Purata = (Tugasan1 + Tugasan2 + Tugasan3) / 15 * 5
                litPurata1.Text = Purata
                SqlDataSource17.UpdateParameters("IdStud").DefaultValue = DataBinder.Eval(e.Row.DataItem, "IdStud")
                SqlDataSource17.UpdateParameters("Jumlah").DefaultValue = litJumlah1.Text
                SqlDataSource17.UpdateParameters("Purata").DefaultValue = litPurata1.Text
                SqlDataSource17.Update()
            End If
            If ((Jumlah >= 0) And (Jumlah <= 7)) Then
                e.Row.CssClass = "red"
            ElseIf ((Jumlah >= 8) And (Jumlah <= 10)) Then
                e.Row.CssClass = "yellow"
            Else
                e.Row.CssClass = "green"

            End If


        End If
    End Sub
    Protected Sub GVPapar_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs)
        If e.Row.RowType = DataControlRowType.DataRow Then
            Dim litPurata As Literal = DirectCast(e.Row.FindControl("litPurata"), Literal)
            Dim litJumlah As Literal = DirectCast(e.Row.FindControl("litJumlah"), Literal)
            Dim Kuiz1 As Double = Convert.ToDouble(DataBinder.Eval(e.Row.DataItem, "KUIZ1"))
            Dim Kuiz2 As Double = Convert.ToDouble(DataBinder.Eval(e.Row.DataItem, "KUIZ2"))
            Dim Kuiz3 As Double = Convert.ToDouble(DataBinder.Eval(e.Row.DataItem, "KUIZ3"))
            Dim Kuiz4 As Double = Convert.ToDouble(DataBinder.Eval(e.Row.DataItem, "KUIZ4"))
            Dim Kuiz5 As Double = Convert.ToDouble(DataBinder.Eval(e.Row.DataItem, "KUIZ5"))
            Dim Jumlah As Double = 0.0
            If litJumlah IsNot Nothing Then
                Jumlah = (Kuiz1 + Kuiz2 + Kuiz3 + Kuiz4 + Kuiz5)
                litJumlah.Text = Jumlah
                Dim Purata As Double = 0.0
                Purata = (Kuiz1 + Kuiz2 + Kuiz3 + Kuiz4 + Kuiz5) / 25 * 5
                litPurata.Text = Purata
                'SqlDataSource23.UpdateParameters("IdStud").DefaultValue = DataBinder.Eval(e.Row.DataItem, "IdStud")
                'SqlDataSource23.UpdateParameters("Jumlah").DefaultValue = litJumlah.Text
                'SqlDataSource23.UpdateParameters("Purata").DefaultValue = litPurata.Text
                'SqlDataSource23.Update()
            End If
            If ((Jumlah >= 0) And (Jumlah <= 13)) Then
                e.Row.CssClass = "red"
            ElseIf ((Jumlah >= 14) And (Jumlah <= 20)) Then
                e.Row.CssClass = "yellow"
            Else
                e.Row.CssClass = "green"
            End If
        End If
    End Sub
    Protected Sub GVPaparMakmal_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs)
        If e.Row.RowType = DataControlRowType.DataRow Then
            Dim Literal1 As Literal = DirectCast(e.Row.FindControl("Literal1"), Literal)
            Dim Literal2 As Literal = DirectCast(e.Row.FindControl("Literal2"), Literal)


            Dim Makmal1 As Double = Convert.ToDouble(DataBinder.Eval(e.Row.DataItem, "Makmal1"))
            Dim Makmal2 As Double = Convert.ToDouble(DataBinder.Eval(e.Row.DataItem, "Makmal2"))
            Dim Makmal3 As Double = Convert.ToDouble(DataBinder.Eval(e.Row.DataItem, "Makmal3"))
            Dim Makmal4 As Double = Convert.ToDouble(DataBinder.Eval(e.Row.DataItem, "Makmal4"))

            Dim Jumlah As Double = 0.0
            If Literal1 IsNot Nothing Then
                Jumlah = (Makmal1 + Makmal2 + Makmal3 + Makmal4)
                Literal1.Text = Jumlah
                Dim Purata As Double = 0.0
                Purata = (Makmal1 + Makmal2 + Makmal3 + Makmal4) / 20 * 15
                Literal2.Text = Purata
                'SqlDataSource18.UpdateParameters("IdStud").DefaultValue = DataBinder.Eval(e.Row.DataItem, "IdStud")
                SqlDataSource18.UpdateParameters("Jumlah").DefaultValue = Literal1.Text
                SqlDataSource18.UpdateParameters("Purata").DefaultValue = Literal2.Text
                SqlDataSource18.Update()
            End If

            'litJumlah.Text = Convert.ToString(Jumlah)
            'litPurata.Text = Convert.ToString(Purata)
            If ((Jumlah >= 0) And (Jumlah <= 10)) Then
                e.Row.CssClass = "red"
            ElseIf ((Jumlah >= 11) And (Jumlah <= 15)) Then
                e.Row.CssClass = "yellow"
            Else
                e.Row.CssClass = "green"

            End If


        End If
    End Sub

    Protected Sub GVPaparProjek_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs)
        If e.Row.RowType = DataControlRowType.DataRow Then
            Dim Literal3 As Literal = DirectCast(e.Row.FindControl("Literal3"), Literal)
            Dim Literal4 As Literal = DirectCast(e.Row.FindControl("Literal4"), Literal)


            Dim Projek1 As Double = Convert.ToDouble(DataBinder.Eval(e.Row.DataItem, "Projek1"))
            Dim Projek2 As Double = Convert.ToDouble(DataBinder.Eval(e.Row.DataItem, "Projek2"))


            Dim Jumlah As Double = 0.0
            If Literal3 IsNot Nothing Then
                Jumlah = (Projek1 + Projek2)
                Literal3.Text = Jumlah
                Dim Purata As Double = 0.0
                Purata = (Projek1 + Projek2) / 20 * 20
                Literal4.Text = Purata
                'SqlDataSource19.UpdateParameters("IdStud").DefaultValue = DataBinder.Eval(e.Row.DataItem, "IdStud")
                SqlDataSource19.UpdateParameters("Jumlah").DefaultValue = Literal3.Text
                SqlDataSource19.UpdateParameters("Purata").DefaultValue = Literal4.Text
                SqlDataSource19.Update()
            End If

            'litJumlah.Text = Convert.ToString(Jumlah)
            'litPurata.Text = Convert.ToString(Purata)
            If ((Jumlah >= 0) And (Jumlah <= 10)) Then
                e.Row.CssClass = "red"
            ElseIf ((Jumlah >= 11) And (Jumlah <= 15)) Then
                e.Row.CssClass = "yellow"
            Else
                e.Row.CssClass = "green"

            End If


        End If
    End Sub


    Protected Sub GVPaparUjian_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs)
        If e.Row.RowType = DataControlRowType.DataRow Then
            Dim Literal5 As Literal = DirectCast(e.Row.FindControl("Literal5"), Literal)
            Dim Literal6 As Literal = DirectCast(e.Row.FindControl("Literal6"), Literal)
            Dim Ujian1 As Double = Convert.ToDouble(DataBinder.Eval(e.Row.DataItem, "Ujian1"))
            Dim Ujian2 As Double = Convert.ToDouble(DataBinder.Eval(e.Row.DataItem, "Ujian2"))
            Dim Jumlah As Double = 0.0
            If Literal5 IsNot Nothing Then
                Jumlah = (Ujian1 + Ujian2)
                Literal5.Text = Jumlah
                Dim Purata As Double = 0.0
                Purata = (Ujian1 + Ujian2) / 200 * 25
                Literal6.Text = Purata
                'SqlDataSource20.UpdateParameters("IdStud").DefaultValue = DataBinder.Eval(e.Row.DataItem, "IdStud")
                SqlDataSource20.UpdateParameters("Jumlah").DefaultValue = Literal5.Text
                SqlDataSource20.UpdateParameters("Purata").DefaultValue = Literal6.Text
                SqlDataSource20.Update()
            End If

            'litJumlah.Text = Convert.ToString(Jumlah)
            'litPurata.Text = Convert.ToString(Purata)
            If ((Jumlah >= 0) And (Jumlah <= 100)) Then
                e.Row.CssClass = "red"
            ElseIf ((Jumlah >= 101) And (Jumlah <= 150)) Then
                e.Row.CssClass = "yellow"
            Else
                e.Row.CssClass = "green"

            End If


        End If
    End Sub


    Protected Sub GVPaparFinal_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs)
        If e.Row.RowType = DataControlRowType.DataRow Then
            Dim Literal7 As Literal = DirectCast(e.Row.FindControl("Literal7"), Literal)
            Dim Literal8 As Literal = DirectCast(e.Row.FindControl("Literal8"), Literal)
            Dim PeperiksaanAkhir As Double = Convert.ToDouble(DataBinder.Eval(e.Row.DataItem, "PeperiksaanAkhir"))
            Dim Jumlah As Double = 0.0
            If Literal7 IsNot Nothing Then
                Jumlah = PeperiksaanAkhir
                Literal7.Text = Jumlah
                Dim Purata As Double = 0.0
                Purata = PeperiksaanAkhir / 100 * 30
                Literal8.Text = Purata
                'SqlDataSource21.UpdateParameters("IdStud").DefaultValue = DataBinder.Eval(e.Row.DataItem, "IdStud")
                SqlDataSource21.UpdateParameters("Jumlah").DefaultValue = Literal7.Text
                SqlDataSource21.UpdateParameters("Purata").DefaultValue = Literal8.Text
                SqlDataSource21.Update()
            End If

            'litJumlah.Text = Convert.ToString(Jumlah)
            'litPurata.Text = Convert.ToString(Purata)
            If ((Jumlah >= 0) And (Jumlah <= 50)) Then
                e.Row.CssClass = "red"
            ElseIf ((Jumlah >= 51) And (Jumlah <= 75)) Then
                e.Row.CssClass = "yellow"
            Else
                e.Row.CssClass = "green"

            End If


        End If
    End Sub
 
    Protected Sub btnSms_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSms.Click
        MsgBox("Adakah semua markah bagi setiap kuiz telah dimasukkan bagi setiap pelajar?", MsgBoxStyle.Critical, "Perhatian!")
        Dim conn As SqlConnection
        Dim strSQL As String
        Dim cmd As SqlCommand
        Dim dr As SqlDataReader
        Dim NoTelefon As String
        conn = New SqlConnection("Data Source=.\SQLEXPRESS; AttachDbFilename=|DataDirectory|\sistempppk.mdf;Integrated Security=True;User Instance=True")
        conn.Open()
        strSQL = "SELECT pelajar.NoTelefon,Kuiz.IdStud FROM pelajar INNER JOIN Kuiz ON pelajar.IdStud = Kuiz.IdStud WHERE((Kuiz.Jumlah >= 0) AND (Kuiz.Jumlah <= 10))AND Kuiz.IdStud >0 "
        cmd = New SqlCommand(strSQL, conn)
        dr = cmd.ExecuteReader
        While dr.Read()
            NoTelefon = dr("NoTelefon")
            Response.Redirect("http://localhost:8800/?PhoneNumber='" & NoTelefon & "'&Text=PERHATIAN!+KERJA+KURSUS+KUIZ+ANDA+BAGI+SUBJEK+" & DropDownList1.SelectedValue & "+BERADA+DI+TAHAP+LEMAH.+UNTUK+MAKLUMAT+LANJUT+SILA+LAYARI+spppk.utm.my")
        End While

        conn.Close()
    End Sub
    Protected Sub btnHantar_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCarian.Click
        GVPapar.Visible = False
        GVPaparTugasan.Visible = False
        GVPaparMakmal.Visible = False
        GVPaparProjek.Visible = False
        GVPaparUjian.Visible = False
        GVPaparFinal.Visible = False
        btnSubmit.Visible = True
        ddlKerjaKursus.Visible = True
        lblSila.Visible = True
        lblKodSubjek.Visible = False
        lblSeksyen.Visible = False
        DropDownList1.Visible = False
        DropDownList2.Visible = False
        btnCarian.Visible = False

    End Sub
    Protected Sub DropDownList3_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ddlKerjaKursus.SelectedIndexChanged
        If ddlKerjaKursus.SelectedValue = "Kuiz" Then
            GVPapar.Visible = True
            GVPaparTugasan.Visible = False
            GVPaparMakmal.Visible = False
            GVPaparProjek.Visible = False
            GVPaparUjian.Visible = False
            GVPaparFinal.Visible = False
            btnSms.Visible = True
            btnSmsTugasan.Visible = False
            btnSmsMakmal.Visible = False
            btnSmsProjek.Visible = False
            btnSmsUjian.Visible = False
            btnSmsPAkhir.Visible = False
            Exit Sub
        ElseIf ddlKerjaKursus.Text = "Tugasan" Then
            GVPaparTugasan.Visible = True
            GVPapar.Visible = False
            GVPaparMakmal.Visible = False
            GVPaparProjek.Visible = False
            GVPaparUjian.Visible = False
            GVPaparFinal.Visible = False
            btnSms.Visible = False
            btnSmsTugasan.Visible = True
            btnSmsMakmal.Visible = False
            btnSmsProjek.Visible = False
            btnSmsUjian.Visible = False
            btnSmsPAkhir.Visible = False
            Exit Sub

        ElseIf ddlKerjaKursus.Text = "Makmal" Then
            GVPaparMakmal.Visible = True
            GVPapar.Visible = False
            GVPaparTugasan.Visible = False
            GVPaparProjek.Visible = False
            GVPaparUjian.Visible = False
            GVPaparFinal.Visible = False
            btnSms.Visible = False
            btnSmsTugasan.Visible = False
            btnSmsMakmal.Visible = True
            btnSmsProjek.Visible = False
            btnSmsUjian.Visible = False
            btnSmsPAkhir.Visible = False
            Exit Sub
        ElseIf ddlKerjaKursus.Text = "Projek" Then
            GVPaparProjek.Visible = True
            GVPapar.Visible = False
            GVPaparTugasan.Visible = False
            GVPaparMakmal.Visible = False
            GVPaparUjian.Visible = False
            GVPaparFinal.Visible = False
            btnSms.Visible = False
            btnSmsTugasan.Visible = False
            btnSmsMakmal.Visible = False
            btnSmsProjek.Visible = True
            btnSmsUjian.Visible = False
            btnSmsPAkhir.Visible = False
            Exit Sub
        ElseIf ddlKerjaKursus.Text = "Ujian" Then
            GVPaparUjian.Visible = True
            GVPapar.Visible = False
            GVPaparTugasan.Visible = False
            GVPaparMakmal.Visible = False
            GVPaparProjek.Visible = False
            GVPaparFinal.Visible = False
            btnSms.Visible = False
            btnSmsTugasan.Visible = False
            btnSmsMakmal.Visible = False
            btnSmsProjek.Visible = False
            btnSmsUjian.Visible = True
            btnSmsPAkhir.Visible = False
            Exit Sub
        Else
            GVPaparFinal.Visible = True
            GVPapar.Visible = False
            GVPaparTugasan.Visible = False
            GVPaparMakmal.Visible = False
            GVPaparProjek.Visible = False
            GVPaparUjian.Visible = False
            btnSms.Visible = False
            btnSmsTugasan.Visible = False
            btnSmsMakmal.Visible = False
            btnSmsProjek.Visible = 
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.