VB.NET - Remove an item from arrData() As DataRow

Posted on 2009-04-29
Last Modified: 2012-05-06
I create an array of DataRows through the following code
arrDistinctUnitList = dt.Select("Ranking = 2")

I have verified that the arrDistinctUnitList array is filled with the correct data as I intended it to be.  Now I'm wanting to loop through it and remove certain DataRows items from the array.

How would I remove an item from the array?
Question by:josephdaviskcrm
    1 Comment
    LVL 4

    Accepted Solution

    if you want to remove any item from the array you should make a shift from the deleted item to the last item; or make the value of the deleted item null; and when you select the item from the array check for the value if it is null or nut;

    but i advice you to use the List; because you can remove the item easily by just calling the Remove method of the list.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Join & Write a Comment

    When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
    I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
    Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
    Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

    754 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

    Need Help in Real-Time?

    Connect with top rated Experts

    25 Experts available now in Live!

    Get 1:1 Help Now