Selected range of records from database | C#
The DataAdapter plays a crucial role as a connector between a DataSet and a data source, facilitating the retrieval and storage of data. When working with the DataAdapter, it adds or refreshes rows in the DataSet to match those in the data source. This synchronization is achieved using the DataSet name, and a DataTable named "Table" is created if it does not already exist.
DataTable objects
In ADO.NET, DataTable objects are utilized to represent tables within a DataSet. The DataSet itself is designed to operate in a disconnected mode, meaning it can hold and manipulate data independently of the data source.
In certain situations, there may be a need to retrieve only a specific range of rows from the data source. In such cases, it is possible to fill the DataSet from the DataAdapter with only the desired range of rows.
The above code will fill the Dataset starting from 5th row and 3 rows.
5 is the starting row no
3 is no of rows we want to fill.
Full Source C#Conclusion
By specifying the starting index and the number of rows to retrieve, the Fill method of the DataAdapter populates the DataSet with only the desired range of rows. The "Table" parameter specifies the name of the DataTable to be created or refreshed within the DataSet. This approach provides flexibility in retrieving data from the data source, allowing for selective retrieval of specific ranges of rows as needed.
- How to DataAdapter in Sql Server
- How to DataAdapter in OLEDB
- How to DataAdapter Select Command - Sql Server
- How to DataAdapter Select Command - OLEDB
- How to DataAdapter Insert Command - Sql Server
- How to DataAdapter Insert Command - OLEDB
- How to DataAdapter Update Command - Sql Server
- How to DataAdapter Update Command - OLEDB
- How to DataAdapter Delete Command - SQL SERVER
- How to DataAdapter Delete Command - OLEDB
- How to DataAdapter CommandBuilder in Sql Server
- How to DataAdapter CommandBuilder in OLEDB
- How to DataAdapter DataGridView - Sql Server
- How to DataAdapter DataGridView - OLEDB