Wayne...
Here's a paste from one of my paging routines.
Dim sText As String = "EqCatECodes"
Dim sConn As String =
"SERVER=localhost;UID=****;PASSWORD=****;DATABASE= YourDB;"
Dim ds As DataSet = New DataSet
Dim cmd As SqlDataAdapter = New SqlDataAdapter(sText, sConn)
cmd.SelectCommand.CommandType = CommandType.StoredProcedure
cmd.SelectCommand.Parameters.Add("@cat", SqlDbType.NChar)
cmd.SelectCommand.Parameters("@cat").Value = Me.tbTarget.Text.ToString
cmd.Fill(ds, cmd.SelectCommand.ToString)
cmd.Dispose()
Me.DataGrid1.DataSource = ds
Me.DataGrid1.DataBind()
DataGrid1.CurrentPageIndex = e.NewPageIndex
DataGrid1.Page.DataBind()
hth,
bob.
"news.microsoft.com" <Me******@community.nospam> wrote in message
news:eL**************@TK2MSFTNGP10.phx.gbl...
I've looked in the help and at each of the properties for the grid view,
but can't seem to find what I need.
I have allowpaging set to true for my gridview and when the page loads I
go and fetch 75 records from the DB, I know there are 750 records total in
the DB.
How can I control the paging? I don't want to go and get all 750 records
at once then allow the grid view to do the paging. Currently the biggest
issue I'm facing is how to tell the Gridview that there are 750 records.
Once I get that I'm assuming I will use the PageIndex Changed to get the
next page of data.
Any points in the right direction would be appreciated.
Thanks
Wayne