Repeater分页的问题?
那位大哥帮我修改一下下面这段代码,因为这段代码我是从C#变过来的,有点错误,但是看不明白?
编译错误
说明: 在编译向该请求提供服务所需资源的过程中出现错误。请检查下列特定错误详细信息并适当地修改源代码。
19行出错
编译器错误信息: BC30203: 需要标识符。
源错误:
行 19: objPds.DataSource = ds.Tables[0].DefaultView
行 20: objPds.AllowPaging = true
行 21: objPds.PageSize = 5
Dim String1 As String
Dim conn As OleDbConnection
Public Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
String1="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&Server.MapPath("database/border.mdb")
conn=New OleDbConnection(String1)
Dim MyCommand As new OleDbDataAdapter("select * from usertable",conn)
Dim ds As new DataSet()
conn.open()
MyCommand.Fill(ds)
Dim objPds As New PagedDataSource()
objPds.DataSource = ds.Tables[0].DefaultView
objPds.AllowPaging = true
objPds.PageSize = 5
Dim CurPage As Integer
If Request.QueryString("Page") <> null Then
CurPage=Convert.ToInt32(Request.QueryString("Page"))
Else
CurPage=1
End If
objPds.CurrentPageIndex = CurPage-1
lblCurrentPage.Text = "当前页:" + CurPage.ToString()
If Not (objPds.IsFirstPage) Then
lnkPrev.NavigateUrl=Request.CurrentExecutionFilePath + "?Page=" + Convert.ToString(CurPage-1)
End If
If Not (objPds.IsLastPage) Then
lnkNext.NavigateUrl=Request.CurrentExecutionFilePath+ "?Page=" + Convert.ToString(CurPage+1)
End If
MyRepeater.DataSource=objPds
MyRepeater.DataBind()
End Sub