Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Visual Basic Inventory

Posted on 2011-10-13
5
Medium Priority
?
215 Views
Last Modified: 2012-05-12
What I would like to accomplish is the following. I have a DB that I built directly inside of Visual Basic.Net. This then puts the database info into a ictpcdatagridview. I have an excel export of data that I am able to load into a datagridview and export items to a ListView. What I would like to get help with is how to compare the ListView to the ictpcdatagridview, so I can see what Items are missing, and then have the missing Items generated in a needtoGet listview. Code is a plus, as I am at a stand still.
0
Comment
Question by:Jack_Jones
  • 3
  • 2
5 Comments
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 36967180
You would have to loop through the items in one of the controls, listview probably, and then try to find that item in grid. If not found, add it to another listbox.
0
 
LVL 1

Author Comment

by:Jack_Jones
ID: 36967743
CODECRUISER how you doing buddy lol! Well I can't seem to picture how to begin the loop, when I tried I only get no where haha. I can loop the listview, but never done it for a datagridview that is populated from a database.
0
 
LVL 1

Author Comment

by:Jack_Jones
ID: 36967780
I could do something like,


For SKU as integer 0 to vehicleSku.items.count - 1
For CHK as integer 0 to datagridview.items.count - 1
  If vehicleSku.Colums(0).listview.items.text = datagridview.rows(0).items.text Then
                missingSku.items.add(datagridview.items(CHK)
End If
Next CHK
Next SKU

Open in new window

0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 2000 total points
ID: 36967985
Try

For SKU as integer 0 to vehicleSku.items.count - 1
    dTable.DefaultView.RowFilter = "columnName=" & vehicleSku.Items(SKU)      'Assuming that dTable is the datatable populating the grid

    if dTable.DefaultView.Count = 0 Then
     missingSku.items.add(datagridview.items(CHK)
    End If
Next SKU
0
 
LVL 1

Author Closing Comment

by:Jack_Jones
ID: 36969742
Little tweaking worked great thanks!
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When you discover the power of the R programming language, you are going to wonder how you ever lived without it! Learn why the language merits a place in your programming arsenal.
Why WooCommerce is one of the majorly favored choices when it comes to having an eCommerce store. This article will acquaint you with some reasons that I believe make it one of the best eCommerce platforms available.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Loops Section Overview

571 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