Dim db As New DB
Dim dt As New DataTable
Sub DisplayZone()
Response.Write(Now.Second)
Dim sql As String
sql = "Select * From tb_zone"
dt = db.QueryDataTable(sql)
GV.DataSource = dt
GV.DataBind()
End Sub
Protected Sub GV_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles GV.Load
If Not Page.IsPostBack Then
DisplayZone()
End If
End Sub
Protected Sub GV_RowCancelingEdit(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GV.RowCancelingEdit
GV.EditIndex = -1
GV.ShowFooter = True
DisplayZone()
End Sub
Protected Sub GV_RowEditing(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GV.RowEditing
GV.EditIndex = e.NewEditIndex
DisplayZone()
End Sub
Protected Sub GV_RowUpdating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GV.RowUpdating
DisplayZone()
End Sub
Tag : ASP.NET MySQL, Web (ASP.NET), VS 2010 (.NET 4.x)