Thread: RE: Records being lost when binding to a repeater
RE: Records being lost when binding to
a repeater
United States
2007-07-27 07:42:29
pagedData.CurrentPageIndex is the reason. I had to start it at 0 as this was
where the records were if it was less than one full page of 50. Now there is
just a page 0 to begin with. Not sure how I could make it so that it doesn't use the 0 position and just starts putting the beginning records on page
1.....
_____
From: AspNetAnyQuestionIsOk%40yahoogroups.com">AspNetAnyQuestionIsOkyahoogroups.com
[mailto: AspNetAnyQuestionIsOk%40yahoogroups.com">AspNetAnyQuestionIsOkyahoogroups.com] On Behalf Of mbelcher
Sent: Wednesday, July 25, 2007 3:57 PM
To: AspNetAnyQuestionIsOk%40yahoogroups.com">AspNetAnyQuestionIsOkyahoogroups.com
Subject: RE: [AspNetAnyQuestionIsOk] Records being lost when binding to a
repeater
I have actually commented that out in the getthedata before. It only removes rows if distance is in the criteria which it isn't at the moment. In the
Sub doPaging() which is after getthedata is ran there is a line that will
assign a session variable with the amount of records returned.
Session("TotalRecords") = pagedData.DataSourceCount.ToString()
it will clearly have a value of 44. Also in the page output I have some test
response.write to output the users found and 44 are printed out in the upper
left hand corner of the page. But for some reason at the end when it binds
the repeater control will not show them. Then just to see what would happen
once I changed pagedData.PageSize = 50 to pagedData.PageSize = 25 and the
repeater showed the records. Makes no sense. I wish html was on with this
email group so you could read it more. I can send to you regular mail if it
will come through clearer. I can also just make a aspgroup account and you
can runt he page yourself and read the values.
_____
From: AspNetAnyQuestionIs <mailto:AspNetAnyQuestionIsOk%40yahoogroups.com>
Ok%40yahoogroups.com">Okyahoogroups.com
[mailto:AspNetAnyQuestionIs <mailto:AspNetAnyQuestionIsOk%40yahoogroups.com>
Ok%40yahoogroups.com">Okyahoogroups.com] On Behalf Of Peter Brunone Sent: Wednesday, July 25, 2007 3:37 PM
To: AspNetAnyQuestionIs <mailto:AspNetAnyQuestionIsOk%40yahoogroups.com>
Ok%40yahoogroups.com">Okyahoogroups.com
Subject: Re: [AspNetAnyQuestionIsOk] Records being lost when binding to a
repeater
I'm a bit confused here. There's too much code (formatted by email) for me
to study without going cross-eyed, but it looks like in getTheData, you're
removing all the rows from the DataTable.
On 7/24/07, mbelcher <AspNetAnyQuestionIs
<mailto:AspNetAnyQuestionIsOk%40faroutcomputersystems.com>
Okfaroutcomputersy <mailto:Ok%40faroutcomputersystems.com> stems.com>
wrote:
> > Heres the funny part. If the records are more than 50 which is the
> "pagedData.PageSize = 50" then they will show up in the output. If it is
> less than 50 nothing shows up. Records are being lost somehow as I see it
> in
> the Sub doPaging() routine. I can see in the trace that it will show that
> the right amount of rows etc exist when it gets to Sub doPaging() but then
> some how they are not being bound or something as it doesn't seem to
> output
> if under the pagedData.PageSize = 50 . any ideas.. >
> Function getTheData() As DataTable
>
> Dim strSQLstring
>
> strSQLstring = Session("SQLstring")
>
> 'Open the Connection ------------------------------------- >
> Dim objConn As SqlConnection
>
> Dim objConnString As String = "Data Source=localhost;Initial
> Catalog=dating;User Id=xxxxxxx;Password=xxxxxx;"
>
> objConn = New SqlClient.SqlConnection(objConnString) >
> objConn.Open()
>
> 'NEW STUFF 5/1/2007 MBELCHER
>
> Dim dt1 As New DataTable("users") >
> Dim adapter As New SqlDataAdapter(strSQLstring, objConn)
>
> adapter.Fill(dt1) >
> 'Distance holder
>
> Dim myDistance As Integer >
> Dim Distance
>
> Dim mySearchDistance 'user max distance
>
> Dim IntCurrentRowUserID As Integer >
> Dim strCurrentRowUser
>
> Dim strCurrentRowCountry
>
> Dim rowIndex As Integer >
> rowIndex = dt1.Rows.Count
>
> 'DEBUG
>
> Response.Write("<b>U