Answers for "datatables remove all rows"

SQL
1

c# remove rows from datatable

for(int i = dtPerson.Rows.Count-1; i >= 0; i--)
{
    DataRow dr = dtPerson.Rows[i];
    if (dr["name"] == "Joe")
        dr.Delete();
}
dtPerson.AcceptChanges();
Posted by: Guest on August-25-2020
0

drop all data from tables

DELETE FROM my_table;			-- all rows, needs a COMMIT to validate
TUNCATE TABLE my_table;			-- all rows, quicker, no possible roolback
Posted by: Guest on May-08-2021

Code answers related to "SQL"

Browse Popular Code Answers by Language