*** หน้า Code ***
Imports System.Data.SqlClient
Imports System.Web.Configuration
Partial Public Class AddMajor
Inherits System.Web.UI.Page
Dim da As SqlDataAdapter
Dim ds As New DataSet
Dim sql1 As String
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
BindData()
End If
End Sub
Dim sql1 As String
Dim dtReader As SqlDataReader
sql1 = "SELECT Major_Id,Major_Name,Course_Id,Sector_Id,Faculty_Id,Receive,EducationBG_Id FROM Major"
com = New SqlCommand(sql1, conn)
dtReader = com.ExecuteReader()
GridView1.DataSource = dtReader
GridView1.DataBind()
dtReader.Close()
dtReader = Nothing