a data access basic question and a calculator question

newbeginner

New member
Joined
Nov 1, 2007
Messages
2
Programming Experience
Beginner
Hi everyone I am new with VB I want to ask I have a listview name lv1
with 2 colmuns (name, price)

Then I added a SQL Database item (database1.mdf) to my project
and I go to database explorer click table to add new table (table1) and it with 2 colmuns (name, price) and set the primary key to name's colmun

so now what code should I set to connect to lv1 when I click a button will show all the data on lv1 and I can add, remove, edit the data to the datatable according lv1 with 3 buttons (add, remove, edit)
like I select a item from lv1 and click edit then it allow to change the info?

second question is if I use a label what code I should use to calculate and show the total price for all item from lv1.subitem

if anyone can help me I will appreicate that
Thank you
 
Try using the DataGridView instead of the ListView

Instead of using the ListView for working with your database. You may wish to use the DataGridView. This is probably the easiest way to add, edit and delete records in your database.

Hope that this will point you in the right direction.
 
Back
Top