Delete Row from DataTable (C#)

Posted on 2006-07-08
Last Modified: 2007-12-19
 I need a help tp write a funtion that gets a parametrs number of Row as R and DataTable as dt
The Function return a new table without the Row number R.

Question by:madmare
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Expert Comment

ID: 17067243
Hello Dear

Pass RowIndex and DataTable it return DataTable without That row

public DataTable DelRow(int RowIndex, DataTable dt)
            return dt;

Accepted Solution

flashaoy earned 500 total points
ID: 17082218

DataTable Delete(DataTable table,int index )
            table.Rows[index ].Delete();
            return table;
DataTable  table=Delete(DataTable1 ,2);
or  u can use this

this peter >>>>
void Delete(ref DataTable table,int index )
            table.Rows[index ].Delete();
Delete(ref DataTable1 ,2);


Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question