The data source does not support server-side data paging.
for my gridview . My codes for the connection to the gridview are :
Protected Sub Page_Load(ByVal sender
As Object,
ByVal e As System.EventArgs)
Handles Me.Load
If Not IsPostBack
Then
LoadData()
End If
End Sub
Sub LoadData()
Dim oledbCon
As OleDbConnection =
New OleDbConnection(System.Configuration.ConfigurationManager.AppSettings("Intermech"))
Dim sqlProduct, sqlCount
As String
sqlProduct =
"SELECT tbl_PRODUCT.IntermechID, tbl_PRODUCT.Description, tbl_PRODUCT.SellingPrice, tbl_CATEGORY.CategoryName FROM tbl_CATEGORY INNER JOIN tbl_PRODUCT ON tbl_CATEGORY.CategoryID = tbl_PRODUCT.CategoryID
WHERE ACTIVE = True"
sqlCount =
"Select count(*) As num FROM tbl_PRODUCT WHERE ACTIVE = TRUE"
Dim productCommand
As New OleDbCommand
Try
productCommand =
New OleDbCommand(sqlProduct, oledbCon)
oledbCon.Open()
Dim productCount
As New OleDbCommand
productCount =
New OleDbCommand(sqlCount, oledbCon)
Dim CountReader
As Integer
CountReader = productCount.ExecuteScalar
lblStatus.Text =
"There are currently " + CountReader.ToString +
" Product(s) "
Dim productReader
As OleDbDataReader
productReader = productCommand.ExecuteReader
gv_Products.DataSource = productReader
gv_Products.DataMember =
"IntermechID"
gv_Products.DataBind()
Catch ex As Exception
lblStatus.Text = ex.Message
Finally
If oledbCon.State = Data.ConnectionState.Open
Then
oledbCon.Close()
End If
End Try
End Sub
Any help is appreciated ! Thank You in advance ! ;)
aaronnn
Member
85 Points
19 Posts
The data source does not support server-side data paging.
Jun 27, 2006 09:51 AM|LINK
Hey all , i seem to have this problem :
The data source does not support server-side data paging.
for my gridview . My codes for the connection to the gridview are :
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Not IsPostBack ThenLoadData()
End If End Sub Sub LoadData() Dim oledbCon As OleDbConnection = New OleDbConnection(System.Configuration.ConfigurationManager.AppSettings("Intermech")) Dim sqlProduct, sqlCount As StringsqlProduct =
"SELECT tbl_PRODUCT.IntermechID, tbl_PRODUCT.Description, tbl_PRODUCT.SellingPrice, tbl_CATEGORY.CategoryName FROM tbl_CATEGORY INNER JOIN tbl_PRODUCT ON tbl_CATEGORY.CategoryID = tbl_PRODUCT.CategoryID WHERE ACTIVE = True"sqlCount =
"Select count(*) As num FROM tbl_PRODUCT WHERE ACTIVE = TRUE" Dim productCommand As New OleDbCommand TryproductCommand =
New OleDbCommand(sqlProduct, oledbCon)oledbCon.Open()
Dim productCount As New OleDbCommandproductCount =
New OleDbCommand(sqlCount, oledbCon) Dim CountReader As IntegerCountReader = productCount.ExecuteScalar
lblStatus.Text =
"There are currently " + CountReader.ToString + " Product(s) " Dim productReader As OleDbDataReaderproductReader = productCommand.ExecuteReader
gv_Products.DataSource = productReader
gv_Products.DataMember =
"IntermechID"gv_Products.DataBind()
Catch ex As ExceptionlblStatus.Text = ex.Message
Finally If oledbCon.State = Data.ConnectionState.Open ThenoledbCon.Close()
End If End Try End SubAny help is appreciated ! Thank You in advance ! ;)