Tuesday, March 20, 2012

Remove duplicate rows in datatable

Function is use to remove duplicate row from the data table
    /// <param name="dt">table from which duplicate row to be deleted</param>
    /// <param name="arrCol">columns in the table.</param>
    /// <returns>return distinct row</returns>
    protected DataTable RemoveDuplicateRowFromTable(DataTable dt, string ColOrgID, string[] strarry)
        DataView view = new DataView(dt);
        DataTable dtReturn = view.ToTable(true,  strarry);
        return dtReturn;

No comments:

Post a Comment