Eti*_*nne 1 c# vb.net asp.net repeater
我正在使用ASP.NET Repeater.
我的Repeater被称为myRepeater,我只想在每页显示20个项目.
可以使用ASP.NET Repeater完成此操作,如果是这样,我必须对下面的代码进行哪些更改?我希望能够利用分页.......... C#的例子也很好!!
' Define data objects
Dim conn As SqlConnection
Dim Comm As SqlCommand
Dim reader As SqlDataReader
conn = New Data.SqlClient.SqlConnection(ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString)
Comm = New SqlCommand( _
("Select * from TableName"), conn)
' Open the connection
conn.Open()
' Execute the category command
reader = Comm.ExecuteReader()
' Bind the reader to the repeater..........
myRepeater.DataSource = reader
myRepeater.DataBind()
' Close the reader
reader.Close()
' Close the connection
conn.Close()
Run Code Online (Sandbox Code Playgroud)
提前致谢!!