-
Why not use controls? repeater or gridview
-
Add me, I'll send you an example, my mailbox zwsh
-
What kind of control pagination are you talking about?
1) The pageindexchanging property in grdiview is pagination.
2) The pagination in the repeater should be written by yourself.
-
The following is a pagination source code I wrote myself, which is not very practical, but the principle is similar, so refer to it.
using system;
using ;
using ;
using ;
Introduce namespaces.
using ;
using ;
commondmethod contains some common methods
public class commondmethod///
Pagination. The bound data source.
The page that is currently displayed.
Set the number of hyperlinks to be displayed, the default is 10, the maximum is 20 Set the number of records displayed per page, 10 records are displayed by default, and the maximum number of records is 20.
Set the page you want to jump to, i.e., this page.
Returns the pagination information as a string.
int totalrecords = 0;
Total number of pages.
/int totalpages = 0;
The number of records displayed per page.
///int recordsofeverypage = 3;
The first record on the current page.
/int firstrecordofcurrentpage = 0;
Displays the current number of records.
/int displaycurrentrecords = 0;
Record the first of the current hyperlink.
/int currentfirstlink = 1;
Record the current total number of hyperlinks to display the maximum number of hyperlinks
int currentlinkcount = 0;
Finally, the information is returned as a string
-
Is it gridview pagination, and if so, there's one in the property that seems to be called allowpaging
-
With LINQ, LINQ does it in two ways, one is the index of the page you are currently on, and the other is the amount of data displayed on each page! It's super easy!
-
The Pagination Control implements the Pagination Work Method step.
1. First of all, let's understand the pagination control - aspnetpager and the properties of the control.
CurrentPageIndex The current number of pages (page number).
recordcount
Total number of data records.
pagesize
Number of data entries per page.
pagecount
Total number of pages. Of course, there are some particularly "human" attributes that can be set.
2. The next thing is to assign values to the control properties, and query the data in the database through SQL statements, sqldataadapter
ada=new
sqldataadapter(new
sqlcommand (sql statement, connecting to database objects);
dataset
ds=new
dataset();
Total data, start, end position);
In this case, dataset-ds is to get the data of the target page, and it is only to get the data that is needed.
3. Finally, you need to display the queried data to the foreground page, and by binding the data source control, the commonly used repeater control can display the data in a loop.
Data;; The repeater control also has a lot of useful functions, and the more you learn, the deeper you study.
4. The pagination control can also set the link text displayed in the foreground of the first page, previous page, next page, and last page of the pagination page. This is just a simple feature, and it is even more convenient to delve into the principles of the analysis.
Information**.
In fact, your ** is basically correct, you have mastered the method of writing this, your questions don't seem to be very clear, you try to see if the following makes you satisfied: >>>More
It's a long time, obviously, there's something wrong with the others!
Is it specific, how to make a two-column method?
If you want to extract 1-8 pieces of data and 9-16 pieces of data, you can write SQL ** as follows. >>>More
Specify the cursor parameter when rs is turned on.
sql,conn,1,1 >>>More
I think the data type of asp should be the data type of vb. >>>More