-
Dec 5th, 2017, 09:36 PM
#1
Thread Starter
New Member
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.
-
Dec 5th, 2017, 10:20 PM
#2
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.
-
Dec 5th, 2017, 10:23 PM
#3
Thread Starter
New Member
Re: Trying to (Add) a column of prices in a listbox
ah alright thanks
il try to change it then
-
Dec 5th, 2017, 10:53 PM
#4
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|