Dim objConn As New OleDbConnection
Dim objCmd As New OleDbCommand
Dim dtAdapter As New OleDbDataAdapter
Dim ds As New DataSet
Dim strConnString,strSQL As String
strConnString = System.Configuration.ConfigurationSettings.AppSettings("########")
strSQL = "SELECT * FROM ###### ORDER BY " & strFields & " ASC"
objConn.ConnectionString = strConnString
With objCmd
.Connection = objConn
.CommandText = strSQL
.CommandType = CommandType.Text
End With
dtAdapter.SelectCommand = objCmd
dtAdapter.Fill(ds)
'*** BindData to DataGrid ***'
GPSHistoryGrid1.DataSource = ds
GPSHistoryGrid1.DataBind()
Dim StrQ As String = ""
'-------------ใส่ข้อมูลในกริด (ย่อๆนะคะ)
StrQ = " SELECT * from cf_circulationhistory "
dt = QueryDataTable(StrQ)
dgrdAccounts.DataSource = dt
dgrdAccounts.DataBind()
'----------------------------
Sub ShowPageCommand(ByVal sender As Object, ByVal e As DataGridPageChangedEventArgs)
dgrdAccounts.CurrentPageIndex = e.NewPageIndex
dgrdAccounts.DataBind()
End Sub