C# - Delete Particular Row from Datatable | Delete Selected Row From DataTable in Asp.net
Introduction:
Here I will explain how to delete particular row from
datatable or delete selected rows from datatable in asp.net
using C# and VB.NET.
Description:
In previous articles I explained Check username availability with progressbar, Richtextbox example in asp.net, Asp.net Interview questions, Joins in SQL Server, Highlight Gridview records based on search and many
articles relating to Gridview,
SQL ,jQuery,asp.net,
C#,VB.NET.
Now I will explain how to delete particular row from datatable or delete
selected rows from datatable in asp.net
using C# and VB.NET.
We can delete datatable rows by using delete method for
that check below code
C# code:
DataTable dt1 = new DataTable();
dt1 = ds.Tables[0];
for (int i = 0; i <
dt.Columns.Count;i++ )
{
if (i == 3)
{
dt.Rows[i - 1].Delete();
dt.AcceptChanges();
}
}
No comments:
Post a Comment