Results 1 to 4 of 4

Thread: Trying to (Add) a column of prices in a listbox

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2017
    Posts
    4

    Unhappy Trying to (Add) a column of prices in a listbox

    I'm a Beginner in Visual basic and i'm trying to figure out what method i should use to add the price column in my list-box.
    The data passed onto the list-box was from an Access DataGridView.
    Name:  Help 2.jpg
Views: 233
Size:  23.4 KB

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    Re: Trying to (Add) a column of prices in a listbox

    ListBoxes don't have columns. Unless you're required to use a ListBox because this is an assignment, don't. You should use a DataGridView as it actually does have columns and can also store actual numbers rather than just text.

  3. #3

    Thread Starter
    New Member
    Join Date
    Dec 2017
    Posts
    4

    Re: Trying to (Add) a column of prices in a listbox

    ah alright thanks
    il try to change it then

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    Re: Trying to (Add) a column of prices in a listbox

    Given that you say that the data came from a DataGridView to begin with, the transfer should be fairly easy. If the data is going to be saved to a database then I'd suggest using a DataTable bound to the grid, so you can then use a data adapter to save directly from the DataTable to the database. In that case, you can simply call the Compute method of the DataTable to get your sum. Otherwise, you can use a loop or a LINQ query.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width