locked
paging datareader/dataset RRS feed

  • Question

  • Hi,

     

    I read first 500 rows into dataset (using datareader) and show it to the user by datagrid.

    when the users scroll till the end of datagrid, i want to append more rows to the dataset

     

    i got the next 500 rows in temporary dataTable and used dataset.Merge()

    this does not refresh the rows in the datagrid.

     

    private void getMoreRows()

    {

    System.Data.DataTable dsTemp = new DataTable();

    dsTemp = GetTable(OdbcDR);

    originalDataSet.Merge(dsTemp);

    originalDataSet.AcceptChanges();

    }

     

    GetTable()

    {

     reads/returns the number of from in to datatable.

    }

     

    I am new to C#, i am assuming i have done some wrong here.

     

    Tuesday, July 24, 2007 11:26 AM

Answers

All replies


  • If I understand your question you want to do DataGrid paging. There is a Microsoft Knowledgebase article that may help:

    How To Perform Paging with the DataGrid Windows Control by Using Visual Basic .NET
    Tuesday, July 24, 2007 12:50 PM
  • thank you paul for your quick response.

     

    But this not exactly what i am after, i am customising my paging.

    for the first call i read n number of records using datareader in dataset then display in datagrid

    then if the user clicks next button i use the same datareader to read the next n number of records.

    the new records i am trying to append to the exsisting dataset/datagrid.

     

    I hope i make it clear.

     

     

    Tuesday, July 24, 2007 2:40 PM
  • thank you paul,

     

    I found the solution.

    Tuesday, July 24, 2007 3:54 PM