Ask Experts Questions for FREE Help!
 

Free Answers in 3 Easy Steps

Register Now
3 Steps
 


Ask QuestionsprogressAnswer QuestionsprogressBuild ReputationprogressBecome an Expert
 
At Ask Me Help Desk you can ask questions in any topic and have them answered for free by our experts. To ask questions or participate in answering them you must register for a free account. By registering you will be able to:
  • Get free answers from experts in any of our 300+ topics.
  • Accept money for answers that you provide.
  • Communicate privately with other members (PM).
  • See fewer ads.
  Answer this Question    Ask about Visual Basic    Ask about another Subject  
 

Mistery1
Aug 27, 2009, 06:44 AM
Hi everyone,

I hope someone can help me.

I have a listbox of many items and a table with many columns to acommodate these items from the listbox. I have basically have for every item in the listbox has its own column in the database.

I need to know when someone closes the application completley, whatever items in this listbox should be inserted into the database, into their respective columns.

This is part of my code that is my main focus , the rest of the code is the connection to the database

For Each item In ListBox2.Items
myCommand.CommandText = "Insert Into Programs (Printer1,Printer2 ) values ('" & ListBox2.Text & "','" & ListBox2.Text & " ')"
myCommand.ExecuteNonQuery()
Next


Anyhelp would be really appreciated.