Código:
El elemento repeater se llama: repeater 1Dim conexion As New OleDbConnection Dim comando As New OleDbCommand Dim adaptador As New OleDbDataAdapter Dim dsproductos As New DataSet Dim pageds As New PagedDataSource conexion.ConnectionString = "cadena de conexion al excel" conexion.Open() comando.CommandText = "SELECT * FROM [tarifa$]" comando.Connection = conexion adaptador.SelectCommand = comando 'llenamos el dataset con los datos de la tabla adaptador.Fill(dsproductos, "productos") pageds.DataSource = dsproductos.Tables("productos").DefaultView pageds.AllowPaging = True pageds.PageSize = 10 Dim curpage As Integer If Not IsNothing(Request.QueryString("Page")) Then curpage = Convert.ToInt32(Request.QueryString("Page")) Else curpage = 1 End If pageds.CurrentPageIndex = curpage - 1 lblCurrpage.Text = "Page: " + curpage.ToString() If Not pageds.IsFirstPage Then lnkPrev.NavigateUrl = Request.CurrentExecutionFilePath + "?Page=" + CStr(curpage - 1) End If If Not pageds.IsLastPage Then lnkNext.NavigateUrl = Request.CurrentExecutionFilePath + "?Page=" + CStr(curpage + 1) End If repeater1.DataSource = pageds repeater1l.DataBind()
El elemento pagedDataSource se llama: pageds
lnkPrev y lnkNext son los link que marcan las paginas anterior y siguiente
Curpage es el entero que identifica el numero de la pagina.
Espero que alguien me pueda ayudar. Muchas gracias a todos por adelantado.
Un saludo.
Pinty