Click here to Skip to main content
14,840,274 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Handling JS file in Resources Pin
M. J. Jaya Chitra23-Mar-10 15:08
MemberM. J. Jaya Chitra23-Mar-10 15:08 
Questionefficiently paging very large record set (~500000) records Pin
uglyeyes22-Mar-10 15:13
Memberuglyeyes22-Mar-10 15:13 
AnswerRe: efficiently paging very large record set (~500000) records Pin
Not Active22-Mar-10 15:32
mentorNot Active22-Mar-10 15:32 
GeneralRe: efficiently paging very large record set (~500000) records Pin
uglyeyes22-Mar-10 15:43
Memberuglyeyes22-Mar-10 15:43 
GeneralRe: efficiently paging very large record set (~500000) records Pin
Not Active22-Mar-10 16:09
mentorNot Active22-Mar-10 16:09 
GeneralRe: efficiently paging very large record set (~500000) records Pin
uglyeyes22-Mar-10 16:44
Memberuglyeyes22-Mar-10 16:44 
GeneralRe: efficiently paging very large record set (~500000) records Pin
Not Active22-Mar-10 16:51
mentorNot Active22-Mar-10 16:51 
GeneralRe: efficiently paging very large record set (~500000) records Pin
uglyeyes22-Mar-10 17:06
Memberuglyeyes22-Mar-10 17:06 
Hi again, this article http://aspalliance.com/157_Paging_in_DataList was someway useful but I have already done that part and it mentions the disadvantage at the end of the article too..

so I changed my database call to add extra parameter i.e. currentindex and total rec to display per page

<pre>
public void AdList(Navigation navigation)
{
List&lt;Advert&gt; adverts = new List&lt;Advert&gt;();
PagedDataSource pds = new PagedDataSource();
pds.AllowPaging = true;
//Based on navigation manage the NowViewing
switch (navigation)
{
case Navigation.Next: //Increment NowViewing by 1
NowViewing++;
break;
case Navigation.Previous: //Decrement NowViewing by 1
NowViewing--;
break;
case Navigation.Last: //Make NowViewing to last page for PagedDataSource
NowViewing = pds.PageCount - 1;
break;

default: //Default NowViewing set to 0
NowViewing = 0;
break;
}
adverts = myBLL.GetAdverts(country, city, adtype,NowViewing,pds.PageSize);
PropertyListCount = adverts.Count;
pds.DataSource = adverts;
pds.PageSize = 10;
//Set the current page index
pds.CurrentPageIndex = NowViewing;


// Disable Prev, Next, First, Last buttons if necessary
lbtnPrev.Enabled = !pds.IsFirstPage;
lbtnNext.Enabled = !pds.IsLastPage;
lbtnFirst.Enabled = !pds.IsFirstPage;
lbtnLast.Enabled = !pds.IsLastPage;

dlPropertyList.DataSource = pds;
dlPropertyList.DataBind();
}
//DataList Pagination Scripts
protected void lbtnPrev_Click(object sender, EventArgs e)
{
PropertyList(Navigation.Previous);
}
protected void lbtnNext_Click(object sender, EventArgs e)
{
PropertyList(Navigation.Next);
}

protected void lbtnFirst_Click(object sender, EventArgs e)
{
PropertyList(Navigation.First);
}

protected void lbtnLast_Click(object sender, EventArgs e)
{
PropertyList(Navigation.Last);
}

public enum Navigation
{
None,
First,
Next,
Previous,
Last,
Pager
}

public int NowViewing
{
get
{
object obj = ViewState["_NowViewing"];
if (obj == null)
return 0;
else
return (int)obj;
}
set
{
this.ViewState["_NowViewing"] = value;
}
}
---STORED proc script
select ROW_NUMBER() OVER(ORDER BY adid) as RowNum,
* from advert where isActive=1 and
c.countryname like '%'+@CountryName+'%' and
a.adcity like '%'+@AdCity+'%' and
a.AdSubCatType like '%'+@AdSubCatType+'%'

) as DerivedTableName
WHERE RowNum BETWEEN @CurrentPageIndex AND (@CurrentPageIndex + @PageSize) - 1
order by adDate desc

</pre>

but this gives only 10 records in one call so how can i display total records, next and previous etc?
GeneralRe: efficiently paging very large record set (~500000) records Pin
uglyeyes22-Mar-10 19:43
Memberuglyeyes22-Mar-10 19:43 
GeneralRe: efficiently paging very large record set (~500000) records Pin
Arindam Tewary22-Mar-10 21:58
professionalArindam Tewary22-Mar-10 21:58 
GeneralRe: efficiently paging very large record set (~500000) records Pin
uglyeyes23-Mar-10 2:04
Memberuglyeyes23-Mar-10 2:04 
Questionload page Pin
future383922-Mar-10 14:32
Memberfuture383922-Mar-10 14:32 
AnswerRe: load page Pin
Not Active22-Mar-10 15:14
mentorNot Active22-Mar-10 15:14 
QuestionMouse Over ASP [modified] Pin
Dalek Dave22-Mar-10 13:17
professionalDalek Dave22-Mar-10 13:17 
AnswerRe: Mouse Over ASP Pin
Not Active22-Mar-10 13:26
mentorNot Active22-Mar-10 13:26 
GeneralRe: Mouse Over ASP Pin
Dalek Dave22-Mar-10 13:44
professionalDalek Dave22-Mar-10 13:44 
GeneralRe: Mouse Over ASP Pin
Not Active22-Mar-10 14:06
mentorNot Active22-Mar-10 14:06 
GeneralRe: Mouse Over ASP Pin
Dalek Dave22-Mar-10 14:18
professionalDalek Dave22-Mar-10 14:18 
GeneralRe: Mouse Over ASP Pin
Dalek Dave22-Mar-10 14:11
professionalDalek Dave22-Mar-10 14:11 
GeneralRe: Mouse Over ASP Pin
Not Active22-Mar-10 14:21
mentorNot Active22-Mar-10 14:21 
GeneralRe: Mouse Over ASP Pin
Dalek Dave22-Mar-10 14:29
professionalDalek Dave22-Mar-10 14:29 
QuestionExporting Crystal Report to Excel 2007 Pin
salman_syed_0122-Mar-10 9:04
Membersalman_syed_0122-Mar-10 9:04 
Questiondeploying asp.net Pin
hotthoughtguy22-Mar-10 6:03
Memberhotthoughtguy22-Mar-10 6:03 
AnswerRe: deploying asp.net Pin
JHizzle22-Mar-10 6:14
MemberJHizzle22-Mar-10 6:14 
AnswerRe: deploying asp.net Pin
J$22-Mar-10 6:57
MemberJ$22-Mar-10 6:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.