How to delete records or data in datatable asp net c#

Опубликовано: 30 Сентябрь 2024
на канале: Coders Media
6,824
14

In order to retain the information that the dataset needs to send updates to the data source, use the Delete method to remove rows in a data table. For example, if your application uses a TableAdapter (or DataAdapter), the adapter's Update method will delete rows in the database that have a RowState of Deleted.
If your application does not need to send updates back to a data source, then it is possible to remove records by directly accessing the data row collection (Remove). For information on locating a specific row in a DataTable, see How to: Locate a Specific Row in a DataTable.