Please help my GridView does not display well after clicking on the next page on the GridView.
when i click on page 2 or next pages this is what is displayed.
Private Sub BindGridP1P2()
Dim constr As String = ConfigurationManager.ConnectionStrings("SMIS2022ConnectionString").ConnectionString
Using con As New SqlConnection(constr)
Using cmd As New SqlCommand("entermarksP1P2")
' Using sda As New SqlDataAdapter()
Using sda As SqlDataAdapter = New SqlDataAdapter(cmd)
cmd.CommandType = CommandType.StoredProcedure
cmd.Parameters.Add("@c", SqlDbType.NVarChar).Value = DropDownList1Class.SelectedItem.Text
cmd.Parameters.Add("@st", SqlDbType.NVarChar).Value = DropDownList2Stream.SelectedItem.Text
cmd.Parameters.Add("@sbj", SqlDbType.NVarChar).Value = DropDownList3Subject.SelectedItem.Text
cmd.Connection = con
sda.SelectCommand = cmd
Using dt As New DataTable()
sda.Fill(dt)
StudentGridMarks.DataSource = dt
StudentGridMarks.DataBind()
End Using
End Using
End Using
End Using
End Sub
Protected Sub OnPageIndexChanging(sender As Object, e As GridViewPageEventArgs)
StudentGridMarks.PageIndex = e.NewPageIndex
If khold = "hold" Then
End If
BindGridP1P2()
End Sub